Commit 1687f8c
committed
Fix ENOTSOCK traceback when iopub socket closes during shutdown
Likely fix nbclient downstream test.
After a control handler completes, process_control unconditionally
publishes an "idle" status. During shutdown this races with
IOPubThread.close(): the IO thread has been joined, so _really_send
runs on the caller's thread while close() runs on another, and the
`if self.closed` check is TOCTOU with the subsequent send_multipart.
Catch the resulting ZMQError(ENOTSOCK) (and AttributeError if
self.socket has flipped to None) in _really_send and log at debug
level instead of letting tornado log an uncaught-callback traceback.1 parent 4abdde1 commit 1687f8c
1 file changed
Lines changed: 17 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| 10 | + | |
10 | 11 | | |
11 | 12 | | |
12 | 13 | | |
| |||
33 | 34 | | |
34 | 35 | | |
35 | 36 | | |
| 37 | + | |
| 38 | + | |
36 | 39 | | |
37 | 40 | | |
38 | 41 | | |
| |||
355 | 358 | | |
356 | 359 | | |
357 | 360 | | |
358 | | - | |
359 | | - | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
360 | 375 | | |
361 | 376 | | |
362 | 377 | | |
| |||
0 commit comments