You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by yl...@apache.org on 2020/12/06 22:35:08 UTC

svn commit: r1884168 - /httpd/httpd/trunk/modules/http2/h2_workers.c

Author: ylavic
Date: Sun Dec  6 22:35:08 2020
New Revision: 1884168

URL: http://svn.apache.org/viewvc?rev=1884168&view=rev
Log:
mod_http2: revert r1883675.

The issue was caused by races in APR_POOL_DEBUG code.

Stopping the h2 workers threads as pre_cleanup of workers->pool is soon enough
since it's a child of pchild already.

Modified:
    httpd/httpd/trunk/modules/http2/h2_workers.c

Modified: httpd/httpd/trunk/modules/http2/h2_workers.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/http2/h2_workers.c?rev=1884168&r1=1884167&r2=1884168&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/http2/h2_workers.c (original)
+++ httpd/httpd/trunk/modules/http2/h2_workers.c Sun Dec  6 22:35:08 2020
@@ -277,7 +277,7 @@ static apr_status_t workers_pool_cleanup
     return APR_SUCCESS;
 }
 
-h2_workers *h2_workers_create(server_rec *s, apr_pool_t *pchild,
+h2_workers *h2_workers_create(server_rec *s, apr_pool_t *server_pool,
                               int min_workers, int max_workers,
                               int idle_secs)
 {
@@ -287,14 +287,14 @@ h2_workers *h2_workers_create(server_rec
     int i, n;
 
     ap_assert(s);
-    ap_assert(pchild);
+    ap_assert(server_pool);
 
     /* let's have our own pool that will be parent to all h2_worker
      * instances we create. This happens in various threads, but always
      * guarded by our lock. Without this pool, all subpool creations would
      * happen on the pool handed to us, which we do not guard.
      */
-    apr_pool_create(&pool, pchild);
+    apr_pool_create(&pool, server_pool);
     apr_pool_tag(pool, "h2_workers");
     workers = apr_pcalloc(pool, sizeof(h2_workers));
     if (!workers) {
@@ -365,10 +365,7 @@ h2_workers *h2_workers_create(server_rec
         workers->dynamic = (workers->worker_count < workers->max_workers);
     }
     if (status == APR_SUCCESS) {
-        /* We want to stop and wait for workers threads before workers->pool
-         * is destroyed, thus as pre_cleanup of the parent pool (pchild).
-         */
-        apr_pool_pre_cleanup_register(pchild, workers, workers_pool_cleanup);    
+        apr_pool_pre_cleanup_register(pool, workers, workers_pool_cleanup);    
         return workers;
     }
     return NULL;