Skip to content

Commit

Permalink
Move busy increment into locked part
Browse files Browse the repository at this point in the history
  • Loading branch information
jajik committed Aug 6, 2024
1 parent de36e1c commit d38bd34
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions native/mod_proxy_cluster/mod_proxy_cluster.c
Original file line number Diff line number Diff line change
Expand Up @@ -3329,9 +3329,6 @@ static int proxy_cluster_pre_request(proxy_worker **worker, proxy_balancer **bal
*worker = runtime;
}

(*worker)->s->busy++;
apr_pool_cleanup_register(r->pool, *worker, decrement_busy_count, apr_pool_cleanup_null);

/* Also mark the context here note that find_best_worker set BALANCER_CONTEXT_ID */
context_id = apr_table_get(r->subprocess_env, "BALANCER_CONTEXT_ID");
ap_assert(node_storage->lock_nodes() == APR_SUCCESS);
Expand All @@ -3343,7 +3340,9 @@ static int proxy_cluster_pre_request(proxy_worker **worker, proxy_balancer **bal
/* XXX: Do we need the lock here??? */
helper = (proxy_cluster_helper *)(*worker)->context;
helper->count_active++;
(*worker)->s->busy++;
node_storage->unlock_nodes();
apr_pool_cleanup_register(r->pool, *worker, decrement_busy_count, apr_pool_cleanup_null);

/*
* get_route_balancer already fills all of the notes and some subprocess_env
Expand Down

0 comments on commit d38bd34

Please sign in to comment.