You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by hw...@apache.org on 2010/03/16 02:28:01 UTC

svn commit: r923534 - in /subversion/branches/1.6.x: ./ STATUS subversion/svnserve/main.c

Author: hwright
Date: Tue Mar 16 01:28:01 2010
New Revision: 923534

URL: http://svn.apache.org/viewvc?rev=923534&view=rev
Log:
Merge r880552 from trunk:

 * r880552
   Try to enable TCP keep-alives in svnserve.
   Justification:
     ra_svn clients do this, too. It should not do any harm.
     Is likely to fix hanging svnserve processes which still linger
     blocking on reads from sockets after days of inactivity on the
     connection, a problem seen and reported by MPlayer developers in #svn.
   Votes:
     +1: stsp, rhuijben, cmpilato

Modified:
    subversion/branches/1.6.x/   (props changed)
    subversion/branches/1.6.x/STATUS
    subversion/branches/1.6.x/subversion/svnserve/main.c

Propchange: subversion/branches/1.6.x/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Mar 16 01:28:01 2010
@@ -55,4 +55,4 @@
 /subversion/branches/tc_url_rev:870696-870828
 /subversion/branches/tree-conflicts:864636-869499
 /subversion/branches/tree-conflicts-notify:870271-870353
-/subversion/trunk:875976,875980-875981,876054-876056,876092,876175,876299,876306,876427,876440,876450,876507,876571,879093,879688,880274-880275,880370,880450,880474,880525-880526,881905,884842,886164,886197,888715,888979,889081,889840,895514,895653,896522,898963,899826,899828,900797
+/subversion/trunk:875976,875980-875981,876054-876056,876092,876175,876299,876306,876427,876440,876450,876507,876571,879093,879688,880274-880275,880370,880450,880474,880525-880526,880552,881905,884842,886164,886197,888715,888979,889081,889840,895514,895653,896522,898963,899826,899828,900797

Modified: subversion/branches/1.6.x/STATUS
URL: http://svn.apache.org/viewvc/subversion/branches/1.6.x/STATUS?rev=923534&r1=923533&r2=923534&view=diff
==============================================================================
--- subversion/branches/1.6.x/STATUS (original)
+++ subversion/branches/1.6.x/STATUS Tue Mar 16 01:28:01 2010
@@ -292,16 +292,6 @@ Veto-blocked changes:
 Approved changes:
 =================
 
- * r880552
-   Try to enable TCP keep-alives in svnserve.
-   Justification:
-     ra_svn clients do this, too. It should not do any harm.
-     Is likely to fix hanging svnserve processes which still linger
-     blocking on reads from sockets after days of inactivity on the
-     connection, a problem seen and reported by MPlayer developers in #svn.
-   Votes:
-     +1: stsp, rhuijben, cmpilato
-
  * r892050, 892085
    Fix a reintegrate bug which can occur when the merge source has mergeinfo
    that explicitly describes common history with the reintegrate target.

Modified: subversion/branches/1.6.x/subversion/svnserve/main.c
URL: http://svn.apache.org/viewvc/subversion/branches/1.6.x/subversion/svnserve/main.c?rev=923534&r1=923533&r2=923534&view=diff
==============================================================================
--- subversion/branches/1.6.x/subversion/svnserve/main.c (original)
+++ subversion/branches/1.6.x/subversion/svnserve/main.c Tue Mar 16 01:28:01 2010
@@ -772,6 +772,20 @@ int main(int argc, const char *argv[])
           return svn_cmdline_handle_exit_error(err, pool, "svnserve: ");
         }
 
+      /* Enable TCP keep-alives on the socket so we time out when
+       * the connection breaks due to network-layer problems.
+       * If the peer has dropped the connection due to a network partition
+       * or a crash, or if the peer no longer considers the connection
+       * valid because we are behind a NAT and our public IP has changed,
+       * it will respond to the keep-alive probe with a RST instead of an
+       * acknowledgment segment, which will cause svn to abort the session
+       * even while it is currently blocked waiting for data from the peer. */
+      status = apr_socket_opt_set(usock, APR_SO_KEEPALIVE, 1);
+      if (status)
+        {
+          /* It's not a fatal error if we cannot enable keep-alives. */
+        }
+
       conn = svn_ra_svn_create_conn(usock, NULL, NULL, connection_pool);
 
       if (run_mode == run_mode_listen_once)