Commit c9cda16
authored
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.
1 parent 78ad7e6 commit c9cda16
1 file changed
+12
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2299 | 2299 | | |
2300 | 2300 | | |
2301 | 2301 | | |
2302 | | - | |
2303 | 2302 | | |
2304 | 2303 | | |
2305 | 2304 | | |
| |||
2436 | 2435 | | |
2437 | 2436 | | |
2438 | 2437 | | |
2439 | | - | |
2440 | | - | |
2441 | | - | |
2442 | | - | |
2443 | 2438 | | |
2444 | 2439 | | |
2445 | 2440 | | |
| |||
2473 | 2468 | | |
2474 | 2469 | | |
2475 | 2470 | | |
| 2471 | + | |
2476 | 2472 | | |
2477 | 2473 | | |
| 2474 | + | |
| 2475 | + | |
| 2476 | + | |
2478 | 2477 | | |
2479 | 2478 | | |
2480 | 2479 | | |
2481 | 2480 | | |
2482 | 2481 | | |
| 2482 | + | |
| 2483 | + | |
2483 | 2484 | | |
2484 | 2485 | | |
2485 | 2486 | | |
2486 | 2487 | | |
| 2488 | + | |
| 2489 | + | |
| 2490 | + | |
2487 | 2491 | | |
2488 | 2492 | | |
2489 | 2493 | | |
2490 | 2494 | | |
| 2495 | + | |
| 2496 | + | |
| 2497 | + | |
2491 | 2498 | | |
2492 | 2499 | | |
2493 | 2500 | | |
| |||
0 commit comments