Commit fc10908
[3.13] pythongh-126500: test_ssl: Don't stop ThreadedEchoServer on OSError in ConnectionHandler; rely on __exit__ (pythonGH-126503) (pythonGH-126571)
pythongh-126500: test_ssl: Don't stop ThreadedEchoServer on OSError in ConnectionHandler; rely on __exit__ (pythonGH-126503)
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 <[email protected]>1 parent 1e4b9c7 commit fc10908
1 file changed
+12
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2312 | 2312 | | |
2313 | 2313 | | |
2314 | 2314 | | |
2315 | | - | |
2316 | 2315 | | |
2317 | 2316 | | |
2318 | 2317 | | |
| |||
2449 | 2448 | | |
2450 | 2449 | | |
2451 | 2450 | | |
2452 | | - | |
2453 | | - | |
2454 | | - | |
2455 | | - | |
2456 | 2451 | | |
2457 | 2452 | | |
2458 | 2453 | | |
| |||
2486 | 2481 | | |
2487 | 2482 | | |
2488 | 2483 | | |
| 2484 | + | |
2489 | 2485 | | |
2490 | 2486 | | |
| 2487 | + | |
| 2488 | + | |
| 2489 | + | |
2491 | 2490 | | |
2492 | 2491 | | |
2493 | 2492 | | |
2494 | 2493 | | |
2495 | 2494 | | |
| 2495 | + | |
| 2496 | + | |
2496 | 2497 | | |
2497 | 2498 | | |
2498 | 2499 | | |
2499 | 2500 | | |
| 2501 | + | |
| 2502 | + | |
| 2503 | + | |
2500 | 2504 | | |
2501 | 2505 | | |
2502 | 2506 | | |
2503 | 2507 | | |
| 2508 | + | |
| 2509 | + | |
| 2510 | + | |
2504 | 2511 | | |
2505 | 2512 | | |
2506 | 2513 | | |
| |||
0 commit comments