git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[JGIT PATCH 0/6] Add timeouts to network IO

From
Shawn O. Pearce <spearce@spearce.org>
Date
Jun 19, 2009, 21:27 UTC
Message-ID
<1245446875-31102-1-git-send-email-spearce@spearce.org>

If there's a bug in the remote peer software, or even just random network hardware/cable failures between us and the remote peer, we might block indefinitely waiting for more incoming data, or waiting for TCP ACKs necessary to release space in our transmit buffer.

This series adds a timeout to everything, allowing the caller to define some maximum waiting period before we abort and declare the remote peer to be unresponsive. The default timeout of 0 will use the traditional "block indefinitely" behavior we have always had.

Shawn O. Pearce (6):
  Create input and output streams that have timeouts
  Add remote.name.timeout to configure an IO timeout
  Add timeouts to smart transport protocol clients
  Add timeouts to smart transport protocol servers
  Add timeouts to anonymous git:// daemon
  Add --timeout command line options
 .../src/org/spearce/jgit/pgm/Daemon.java           |    5 +
 .../src/org/spearce/jgit/pgm/Fetch.java            |    5 +
 .../src/org/spearce/jgit/pgm/LsRemote.java         |    6 +
 .../src/org/spearce/jgit/pgm/Push.java             |    5 +
 .../src/org/spearce/jgit/pgm/UploadPack.java       |    6 +
 .../spearce/jgit/transport/RemoteConfigTest.java   |   26 ++
 .../jgit/util/io/TimeoutInputStreamTest.java       |  187 +++++++++++++
 .../jgit/util/io/TimeoutOutputStreamTest.java      |  286 ++++++++++++++++++++
 .../spearce/jgit/transport/BasePackConnection.java |   36 +++-
 .../jgit/transport/BasePackPushConnection.java     |   29 ++-
 .../src/org/spearce/jgit/transport/Daemon.java     |   26 ++-
 .../org/spearce/jgit/transport/DaemonClient.java   |   12 +-
 .../org/spearce/jgit/transport/ReceivePack.java    |   57 ++++
 .../org/spearce/jgit/transport/RemoteConfig.java   |   31 +++
 .../org/spearce/jgit/transport/SshTransport.java   |    3 +-
 .../src/org/spearce/jgit/transport/Transport.java  |   21 ++
 .../spearce/jgit/transport/TransportGitAnon.java   |   13 +-
 .../spearce/jgit/transport/TransportGitSsh.java    |  103 +++++++-
 .../org/spearce/jgit/transport/TransportLocal.java |    9 +-
 .../org/spearce/jgit/transport/TransportSftp.java  |    3 +-
 .../src/org/spearce/jgit/transport/UploadPack.java |   59 ++++-
 .../org/spearce/jgit/util/io/InterruptTimer.java   |  216 +++++++++++++++
 .../spearce/jgit/util/io/TimeoutInputStream.java   |  133 +++++++++
 .../spearce/jgit/util/io/TimeoutOutputStream.java  |  146 ++++++++++
 24 files changed, 1400 insertions(+), 23 deletions(-)
 create mode 100644 org.spearce.jgit.test/tst/org/spearce/jgit/util/io/TimeoutInputStreamTest.java
 create mode 100644 org.spearce.jgit.test/tst/org/spearce/jgit/util/io/TimeoutOutputStreamTest.java
 create mode 100644 org.spearce.jgit/src/org/spearce/jgit/util/io/InterruptTimer.java
 create mode 100644 org.spearce.jgit/src/org/spearce/jgit/util/io/TimeoutInputStream.java
 create mode 100644 org.spearce.jgit/src/org/spearce/jgit/util/io/TimeoutOutputStream.java
Next: Shawn O. Pearce
Message 1 of 11 in “Add timeouts to network IO”
  1. 0/6 Add timeouts to network IOShawn O. Pearce, Jun 19, 2009
  2. 1/6 Create input and output streams that have timeoutsShawn O. Pearce, Jun 19, 2009
  3. 2/6 Add remote.name.timeout to configure an IO timeoutShawn O. Pearce, Jun 19, 2009
  4. 3/6 Add timeouts to smart transport protocol clientsShawn O. Pearce, Jun 19, 2009
  5. 4/6 Add timeouts to smart transport protocol serversShawn O. Pearce, Jun 19, 2009
  6. 5/6 Add timeouts to anonymous git:// daemonShawn O. Pearce, Jun 19, 2009
  7. 6/6 Add --timeout command line optionsShawn O. Pearce, Jun 19, 2009
  8. Robin RosenbergJun 20, 2009
  9. Shawn O. PearceJun 20, 2009
  10. Robin RosenbergJun 22, 2009
  11. 1/6 Create input and output streams that have timeoutsShawn O. Pearce, Jun 23, 2009

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.