-
Notifications
You must be signed in to change notification settings - Fork 3k
add max_connections_open option for httpc profile #9712
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: maint
Are you sure you want to change the base?
add max_connections_open option for httpc profile #9712
Conversation
CT Test Results 2 files 23 suites 10m 58s ⏱️ Results for commit ec7eab2. ♻️ This comment has been updated with latest results. To speed up review, make sure that you have read Contributing to Erlang/OTP and that all checks pass. See the TESTING and DEVELOPMENT HowTo guides for details about how to run test locally. Artifacts
// Erlang/OTP Github Action Bot |
2a8a4ad to
4e3f24f
Compare
4e3f24f to
92f73a1
Compare
|
@github-actions disable-cache |
465413d to
5e33cc0
Compare
7acd444 to
2e53f7f
Compare
|
solves #8841 |
2e53f7f to
f1603f9
Compare
bd74dab to
2ca8d94
Compare
6b02113 to
2974eac
Compare
f143915 to
d8a005b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR introduces a new option max_connections_open for the HTTP client profile to limit the maximum number of concurrent HTTP handlers that can be open simultaneously. This feature helps prevent bandwidth exhaustion when multiple requests are processed concurrently and remote servers close connections before requests complete.
- Adds
max_connections_openoption to limit concurrent HTTP handlers - Implements request queuing mechanism when handler limit is reached
- Adds comprehensive test coverage for high-load scenarios with both HTTP and HTTPS
Reviewed Changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
system/doc/general_info/upcoming_incompatibilities.md |
Documents the new option as an upcoming feature |
lib/inets/src/http_client/httpc_internal.hrl |
Adds max_connections_open field to options record |
lib/inets/src/http_client/httpc.erl |
Implements option validation and documentation |
lib/inets/src/http_client/httpc_manager.erl |
Core logic for handler limiting and request queuing |
lib/inets/test/httpc_SUITE.erl |
Comprehensive test suite for high-load scenarios |
lib/inets/test/http_test_lib.erl |
Minor test infrastructure update |
lib/inets/src/http_client/httpc_response.erl |
Cache renewal marker |
lib/inets/src/http_client/httpc_request.erl |
Cache renewal marker |
lib/inets/src/http_client/httpc_handler.erl |
Cache renewal marker |
lib/inets/src/http_client/httpc_cookie.erl |
Cache renewal marker |
Comments suppressed due to low confidence (2)
system/doc/general_info/upcoming_incompatibilities.md:259
- The option name in documentation should match the actual implementation. Use
max_connections_openconsistently throughout.
New option in Inets' http client `httpc:set_options([{max_connections_open, N}])`
lib/inets/src/http_client/httpc.erl:1649
- [nitpick] Function name is inconsistent with the option name
max_connections_open. Consider renaming tovalidate_max_sessions_max_handlers_openor updating the option name for consistency.
validate_max_sessions_max_connections_open(MaxSessions, MaxConnectionsOpen)
2eebe76 to
40ab8e6
Compare
lib/inets/src/http_client/httpc.erl
Outdated
| validate_max_sessions(Value), | ||
| validate_options(Tail, [Opt | Acc]); | ||
|
|
||
| validate_options([{max_connections_open, Value} = Opt| Tail], Acc) -> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
space missing before |
| -doc(#{equiv => set_options/2}). | ||
| -doc(#{since => <<"OTP R13B04">>}). | ||
| -spec set_options(Options) -> ok | {error, Reason} when | ||
| Options :: [Option], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
general comment: please squash commits before merging (unless there is some information in how they're split now)
lib/inets/src/http_client/httpc.erl
Outdated
| (is_integer(Value) andalso (Value > 0)) orelse | ||
| Value =:= infinity -> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
2e3f864 to
b9bf05f
Compare
8e04927 to
d556ef4
Compare
7a10c76 to
9afb929
Compare
9afb929 to
8c3bc1e
Compare
8c3bc1e to
ec7eab2
Compare

No description provided.