aio-libs
aiohttp
BlogDocsChangelog

[PR #10551/d067260d backport][3.12] Re-raise OSError as ClientConnectionError when failing to explicitly close connector socket

#10562Merged
Comparing
patchback/backports/3.12/d067260df75e4d04a23a0481cf9cf8f7194c80f1/pr-10551
(
f5b6530
) with
3.12
(
25c9ab8
)
CodSpeed Performance Gauge
0%
Untouched
47
Ignored
2

Benchmarks

Passed

test_create_client_request_with_headers[pyloop]
tests/test_benchmarks_client_request.py
CodSpeed Performance Gauge
+1%
70.8 µs69.9 µs
test_resolve_multiple_fixed_url_with_many_routes[pyloop]
tests/test_benchmarks_web_urldispatcher.py
CodSpeed Performance Gauge
+1%
2.2 ms2.2 ms
test_one_thousand_round_trip_websocket_binary_messages[pyloop]
tests/test_benchmarks_client_ws.py
CodSpeed Performance Gauge
+1%
17.1 ms17 ms
test_simple_web_stream_response
tests/test_benchmarks_web_response.py
CodSpeed Performance Gauge
0%
242.6 µs241.4 µs
test_one_thousand_round_trip_websocket_text_messages[pyloop]
tests/test_benchmarks_client_ws.py
CodSpeed Performance Gauge
0%
17.5 ms17.5 ms
test_resolve_static_root_route[pyloop]
tests/test_benchmarks_web_urldispatcher.py
CodSpeed Performance Gauge
0%
982.5 µs978 µs
test_resolve_dynamic_resource_url_with_many_static_routes[pyloop]
tests/test_benchmarks_web_urldispatcher.py
CodSpeed Performance Gauge
0%
3.6 ms3.6 ms
test_resolve_prefix_resources_many_prefix_many_plain[pyloop]
tests/test_benchmarks_web_urldispatcher.py
CodSpeed Performance Gauge
0%
4.9 ms4.9 ms
test_resolve_dynamic_resource_url_with_many_dynamic_routes[pyloop]
tests/test_benchmarks_web_urldispatcher.py
CodSpeed Performance Gauge
0%
3.6 ms3.5 ms
test_web_response_with_bytes_body
tests/test_benchmarks_web_response.py
CodSpeed Performance Gauge
0%
539.1 µs538.5 µs
test_one_hundred_get_requests_with_512kib_content_length_payload[pyloop]
tests/test_benchmarks_client.py
CodSpeed Performance Gauge
0%
164.8 ms164.7 ms
test_simple_web_file_response[pyloop]
tests/test_benchmarks_web_fileresponse.py
CodSpeed Performance Gauge
0%
78.6 ms78.5 ms
test_resolve_single_fixed_url_with_many_routes[pyloop]
tests/test_benchmarks_web_urldispatcher.py
CodSpeed Performance Gauge
0%
890.5 µs889.7 µs
test_send_one_hundred_large_websocket_text_messages[pyloop]
tests/test_benchmarks_http_websocket.py
CodSpeed Performance Gauge
0%
535.5 µs535.1 µs
test_simple_web_file_sendfile_fallback_response[pyloop]
tests/test_benchmarks_web_fileresponse.py
CodSpeed Performance Gauge
0%
84.1 ms84.1 ms
test_one_hundred_json_post_requests[pyloop]
tests/test_benchmarks_client.py
CodSpeed Performance Gauge
0%
38.6 ms38.5 ms
test_one_hundred_simple_get_requests[pyloop]
tests/test_benchmarks_client.py
CodSpeed Performance Gauge
0%
32.2 ms32.2 ms
test_resolve_gitapi_root[pyloop]
tests/test_benchmarks_web_urldispatcher.py
CodSpeed Performance Gauge
0%
2 ms2 ms
test_resolve_multiple_level_fixed_url_with_many_routes[pyloop]
tests/test_benchmarks_web_urldispatcher.py
CodSpeed Performance Gauge
0%
8.6 ms8.6 ms
test_send_one_hundred_websocket_compressed_messages[pyloop]
tests/test_benchmarks_http_websocket.py
CodSpeed Performance Gauge
0%
3 ms3 ms
test_get_request_with_251308_compressed_chunked_payload[pyloop]
tests/test_benchmarks_client.py
CodSpeed Performance Gauge
0%
425.9 ms425.9 ms
test_one_hundred_simple_get_requests_multiple_methods_route[pyloop]
tests/test_benchmarks_client.py
CodSpeed Performance Gauge
0%
32 ms32 ms
test_send_client_request_one_hundred[pyloop]
tests/test_benchmarks_client_request.py
CodSpeed Performance Gauge
0%
2.4 ms2.4 ms
test_read_large_binary_websocket_messages[pyloop]
tests/test_benchmarks_http_websocket.py
CodSpeed Performance Gauge
0%
9.1 ms9.1 ms
test_simple_web_file_response_not_modified[pyloop]
tests/test_benchmarks_web_fileresponse.py
CodSpeed Performance Gauge
0%
55.3 ms55.3 ms
test_ten_web_middlewares[pyloop]
tests/test_benchmarks_web_middleware.py
CodSpeed Performance Gauge
0%
35 ms35.1 ms
test_one_hundred_simple_post_requests[pyloop]
tests/test_benchmarks_client.py
CodSpeed Performance Gauge
0%
36.7 ms36.8 ms
test_web_response_with_text_body
tests/test_benchmarks_web_response.py
CodSpeed Performance Gauge
0%
654.8 µs655.4 µs
test_one_hundred_get_requests_with_30000_chunked_payload[pyloop]
tests/test_benchmarks_client.py
CodSpeed Performance Gauge
0%
40.5 ms40.6 ms
test_simple_web_response
tests/test_benchmarks_web_response.py
CodSpeed Performance Gauge
0%
447.2 µs447.8 µs
test_one_hundred_get_requests_with_1024_content_length_payload[pyloop]
tests/test_benchmarks_client.py
CodSpeed Performance Gauge
0%
35.2 ms35.2 ms
test_one_hundred_get_requests_with_30000_content_length_payload[pyloop]
tests/test_benchmarks_client.py
CodSpeed Performance Gauge
0%
39.4 ms39.4 ms
test_one_hundred_get_requests_with_1024_chunked_payload[pyloop]
tests/test_benchmarks_client.py
CodSpeed Performance Gauge
0%
35.5 ms35.5 ms
test_resolve_root_route[pyloop]
tests/test_benchmarks_web_urldispatcher.py
CodSpeed Performance Gauge
0%
880.3 µs882.5 µs
test_send_one_hundred_websocket_text_messages[pyloop]
tests/test_benchmarks_http_websocket.py
CodSpeed Performance Gauge
0%
562.7 µs564.3 µs
test_resolve_gitapi[pyloop]
tests/test_benchmarks_web_urldispatcher.py
CodSpeed Performance Gauge
0%
293.4 ms294.3 ms
test_client_request_update_cookies[pyloop]
tests/test_benchmarks_client_request.py
CodSpeed Performance Gauge
0%
169.4 µs170 µs
test_serialize_headers
tests/test_benchmarks_http_writer.py
CodSpeed Performance Gauge
0%
1 ms1 ms
test_create_client_request_with_cookies[pyloop]
tests/test_benchmarks_client_request.py
CodSpeed Performance Gauge
0%
125.6 µs126.1 µs
test_send_one_hundred_websocket_text_messages_with_mask[pyloop]
tests/test_benchmarks_http_websocket.py
CodSpeed Performance Gauge
0%
795.7 µs799.7 µs
test_resolve_gitapi_subapps[pyloop]
tests/test_benchmarks_web_urldispatcher.py
CodSpeed Performance Gauge
-1%
295.9 ms297.7 ms
test_web_response_with_headers
tests/test_benchmarks_web_response.py
CodSpeed Performance Gauge
-1%
880.1 µs885.4 µs
test_resolve_dynamic_resource_url_with_many_dynamic_routes_with_common_prefix[pyloop]
tests/test_benchmarks_web_urldispatcher.py
CodSpeed Performance Gauge
-1%
245.8 ms247.6 ms
test_resolve_root_route_with_many_fixed_routes[pyloop]
tests/test_benchmarks_web_urldispatcher.py
CodSpeed Performance Gauge
-1%
882.1 µs889.1 µs
test_read_one_hundred_websocket_text_messages[pyloop]
tests/test_benchmarks_http_websocket.py
CodSpeed Performance Gauge
-1%
298 µs300.4 µs
test_load_cookies_into_temp_cookiejar
tests/test_benchmarks_cookiejar.py
CodSpeed Performance Gauge
-1%
202.8 µs204.6 µs
test_one_thousand_large_round_trip_websocket_text_messages[pyloop]
tests/test_benchmarks_client_ws.py
CodSpeed Performance Gauge
-4%
23.3 ms24.3 ms

Ignored

test_one_hundred_get_requests_with_512kib_chunked_payload[pyloop]
tests/test_benchmarks_client.py
Ignored
CodSpeed Performance Gauge
-12%
166.3 ms188.6 ms
test_one_hundred_get_requests_iter_chunks_on_512kib_chunked_payload[pyloop]
tests/test_benchmarks_client.py
Ignored
CodSpeed Performance Gauge
-19%
97 ms119.5 ms

Commits

Click on a commit to change the comparison range
Base
3.12
25c9ab8
-0.14%
Re-raise OSError as ClientConnectionError when failing to explicitly close connector socket (#10551) <!-- Thank you for your contribution! --> ## What do these changes do? This is a followup to #10464 to handle the case where `socket.close()` can also raise. This matches the logic we have in aiohappyeyeballs: https://github.com/aio-libs/aiohappyeyeballs/blob/e3bd5bdf44f5d187802de6dcb08d27e1ca6da048/src/aiohappyeyeballs/impl.py#L227 We shouldn't raising `OSError` externally from this method as callers expect a `ClientError` ## Are there changes in behavior for the user? bugfix ## Is it a substantial burden for the maintainers to support this? no ## Related issue number fixes #10506 ## Checklist - [x] I think the code is well written - [x] Unit tests for the changes exist - [x] Documentation reflects the changes - [x] If you provide code modification, please add yourself to `CONTRIBUTORS.txt` * The format is &lt;Name&gt; &lt;Surname&gt;. * Please keep alphabetical order, the file is sorted by names. - [x] Add a new news fragment into the `CHANGES/` folder * name it `<issue_or_pr_num>.<type>.rst` (e.g. `588.bugfix.rst`) * if you don't have an issue number, change it to the pull request number after creating the PR * `.bugfix`: A bug fix for something the maintainers deemed an improper undesired behavior that got corrected to match pre-agreed expectations. * `.feature`: A new behavior, public APIs. That sort of stuff. * `.deprecation`: A declaration of future API removals and breaking changes in behavior. * `.breaking`: When something public is removed in a breaking way. Could be deprecated in an earlier release. * `.doc`: Notable updates to the documentation structure or build process. * `.packaging`: Notes for downstreams about unobvious side effects and tooling. Changes in the test invocation considerations and runtime assumptions. * `.contrib`: Stuff that affects the contributor experience. e.g. Running tests, building the docs, setting up the development environment. * `.misc`: Changes that are hard to assign to any of the above categories. * Make sure to use full sentences with correct case and punctuation, for example: ```rst Fixed issue with non-ascii contents in doctest text files -- by :user:`contributor-gh-handle`. ``` Use the past tense or the present tense a non-imperative mood, referring to what's changed compared to the last released version of this project. (cherry picked from commit d067260df75e4d04a23a0481cf9cf8f7194c80f1)
f5b6530
8 months ago
by bdraco
© 2025 CodSpeed Technology
Home Terms Privacy Docs