Title: [3.12] gh-126500: test_ssl: Don't stop ThreadedEchoServer on OSError in ConnectionHandler; rely on __exit__ (GH-126503) by miss-islington · Pull Request #126572 · python/cpython · GitHub
Open Graph Title: [3.12] gh-126500: test_ssl: Don't stop ThreadedEchoServer on OSError in ConnectionHandler; rely on __exit__ (GH-126503) by miss-islington · Pull Request #126572 · python/cpython
X Title: [3.12] gh-126500: test_ssl: Don't stop ThreadedEchoServer on OSError in ConnectionHandler; rely on __exit__ (GH-126503) by miss-islington · Pull Request #126572 · python/cpython
Description: If read() in the ConnectionHandler thread raises OSError (except ConnectionError), the ConnectionHandler shuts down the entire ThreadedEchoServer, preventing further connections. It also does that for EPROTOTYPE in wrap_conn. As far as I can see, this is done to avoid the server thread getting stuck, forgotten, in its accept loop. However, since 2011 (5b95eb9) the server is used as a context manager, and its __exit__ does stop() and join(). (I'm not sure if we always used with since that commit, but currently we do.) Make sure that the context manager is used, and remove the server.stop() calls from ConnectionHandler. (cherry picked from commit c9cda16) Co-authored-by: Petr Viktorin encukou@gmail.com Issue: gh-126500
Open Graph Description: If read() in the ConnectionHandler thread raises OSError (except ConnectionError), the ConnectionHandler shuts down the entire ThreadedEchoServer, preventing further connections. It also does that ...
X Description: If read() in the ConnectionHandler thread raises OSError (except ConnectionError), the ConnectionHandler shuts down the entire ThreadedEchoServer, preventing further connections. It also does that ...
Opengraph URL: https://github.com/python/cpython/pull/126572
X: @github
Domain: github.com
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:5878b7a0-09e5-236b-a65d-f901969a8abe |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | C380:35D20C:27D9BC:359264:6A57F9B0 |
| html-safe-nonce | 9ce2ef5e9510fdc8b83b8c2da71cc10e43ff9a51bea3faf00c18208ecf3fef54 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDMzgwOjM1RDIwQzoyN0Q5QkM6MzU5MjY0OjZBNTdGOUIwIiwidmlzaXRvcl9pZCI6IjU4NTcyNDE2MTk5NzY2ODE5MDUiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 08fb5bba2b9a0ce382476222e845b0785ce45150e25530dde1edcc83f70f0ca3 |
| hovercard-subject-tag | pull_request:2169334521 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/python/cpython/pull/126572/files |
| twitter:image | https://avatars.githubusercontent.com/u/31488909?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/31488909?s=400&v=4 |
| og:image:alt | If read() in the ConnectionHandler thread raises OSError (except ConnectionError), the ConnectionHandler shuts down the entire ThreadedEchoServer, preventing further connections. It also does that ... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | 49c8c15fabcbf356d607a90ca115c13b273e42ff8b74155de050fd229a9b0121 |
| turbo-cache-control | no-preview |
| diff-view | unified |
| go-import | github.com/python/cpython git https://github.com/python/cpython.git |
| octolytics-dimension-user_id | 1525981 |
| octolytics-dimension-user_login | python |
| octolytics-dimension-repository_id | 81598961 |
| octolytics-dimension-repository_nwo | python/cpython |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 81598961 |
| octolytics-dimension-repository_network_root_nwo | python/cpython |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 3fb1f684e7a833eb1b2d01d39875a2b52cb4fe9b |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width