subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From stef...@apache.org
Subject svn commit: r1545943 - /subversion/trunk/subversion/svnserve/svnserve.c
Date Wed, 27 Nov 2013 06:59:41 GMT
Author: stefan2
Date: Wed Nov 27 06:59:41 2013
New Revision: 1545943

URL: http://svn.apache.org/r1545943
Log:
Explicitly terminate the thread pool in svnserve.

Just like in our latest change to the C test framework, svnserve uses
APR thread pools.  Hence, we might run into the same cleanup ordering
issue that we observed in the tests.

* subversion/svnserve/svnserve.c
  (sub_main): Always initialize the THREADS variable.
  (main): If thread pools were used, make sure to empty them
          before destroying memory pools.

Modified:
    subversion/trunk/subversion/svnserve/svnserve.c

Modified: subversion/trunk/subversion/svnserve/svnserve.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/svnserve/svnserve.c?rev=1545943&r1=1545942&r2=1545943&view=diff
==============================================================================
--- subversion/trunk/subversion/svnserve/svnserve.c (original)
+++ subversion/trunk/subversion/svnserve/svnserve.c Wed Nov 27 06:59:41 2013
@@ -1253,6 +1253,10 @@ sub_main(int *exit_code, int argc, const
       /* don't queue requests unless we reached the worker thread limit */
       apr_thread_pool_threshold_set(threads, 0);
     }
+  else
+    {
+      threads = NULL;
+    }
 #endif
 
   while (1)
@@ -1360,6 +1364,14 @@ main(int argc, const char *argv[])
       svn_cmdline_handle_exit_error(err, NULL, "svnserve: ");
     }
 
+#if HAVE_THREADPOOLS
+  /* Explicitly wait for all threads to exit.  As we found out with similar
+     code in our C test framework, the memory pool cleanup below cannot be
+     trusted to do the right thing. */
+  if (threads)
+    apr_thread_pool_destroy(threads);
+#endif
+
   /* this will also close the server's socket */
   svn_pool_destroy(pool);
   return exit_code;



Mime
View raw message