File tree Expand file tree Collapse file tree 1 file changed +5
-6
lines changed Expand file tree Collapse file tree 1 file changed +5
-6
lines changed Original file line number Diff line number Diff line change @@ -722,15 +722,14 @@ struct flb_connection *flb_upstream_conn_get(struct flb_upstream *u)
722
722
* - if keepalive is disabled, the connection is moved to 'drop_queue' then is
723
723
* closed and destroyed.
724
724
*
725
- * Based on the logic described above, to limit the number of total connections
726
- * in the worker, we only need to count the number of connections linked into
727
- * the 'busy_queue' list because if there are connections available 'av_queue' it
728
- * won't create a one.
725
+ * To enforce a limit in the number of connections, we must count count all the
726
+ * queues since they represent open connections.
729
727
*/
730
728
731
- /* Count the number of relevant connections */
732
729
flb_stream_acquire_lock (& u -> base , FLB_TRUE );
733
- total_connections = mk_list_size (& uq -> busy_queue );
730
+ total_connections = mk_list_size (& uq -> busy_queue ) +
731
+ mk_list_size (& uq -> av_queue ) +
732
+ mk_list_size (& uq -> destroy_queue );
734
733
flb_stream_release_lock (& u -> base );
735
734
736
735
if (total_connections >= u -> base .net .max_worker_connections ) {
You can’t perform that action at this time.
0 commit comments