awslabs / aws-c-http

C99 implementation of the HTTP/1.1 and HTTP/2 specifications
Apache License 2.0
136 stars 42 forks source link

Fix max_pending_connection_acquisitions to respect connection pool size #485

Closed waahm7 closed 2 months ago

waahm7 commented 2 months ago

Description of changes: The previous implementation was too aggressive regarding max_pending_connection_acquisitions. If the max_connections were 50 and max_pending_connection_acquisitions was 10, the 11th acquire request failed even though it was within the max connection limit. This PR changes the implementation to prioritize max_connections first and only fail the 61st request. This change is similar to Netty Behavior By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

codecov-commenter commented 2 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 79.62%. Comparing base (4e74ab1) to head (b7c62ca).

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #485 +/- ## ========================================== + Coverage 79.59% 79.62% +0.02% ========================================== Files 27 27 Lines 11684 11684 ========================================== + Hits 9300 9303 +3 + Misses 2384 2381 -3 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.