Commit 9ee5fee
committed
Fix crash closing already-closed socket. Refs #1596
```
error: uncaptured python exception, closing channel <supervisor.http.deferring_http_channel connected 127.0.0.1:58792 at 0x102d3a310 channel#: 0 requests:4> (<class 'OSError'>:[Errno 57] Socket is not connected [/Users/username/git/supervisor/supervisor/medusa/asynchat_25.py|handle_read|89] [/Users/username/git/supervisor/supervisor/medusa/http_server.py|recv|528] [/Users/username/git/supervisor/supervisor/medusa/asyncore_25.py|recv|354] [/Users/username/git/supervisor/supervisor/medusa/asynchat_25.py|handle_close|156] [/Users/username/git/supervisor/supervisor/medusa/asyncore_25.py|close|361])
error: uncaptured python exception, closing channel <supervisor.http.deferring_http_channel connected 127.0.0.1:58792 at 0x102d3a310 channel#: 0 requests:4> (<class 'OSError'>:[Errno 57] Socket is not connected [/Users/username/git/supervisor/supervisor/supervisord.py|runforever|218] [/Users/username/git/supervisor/supervisor/medusa/asyncore_25.py|handle_read_event|392] [/Users/username/git/supervisor/supervisor/medusa/asynchat_25.py|handle_read|91] [/Users/username/git/supervisor/supervisor/medusa/http_server.py|handle_error|546] [/Users/username/git/supervisor/supervisor/medusa/asyncore_25.py|handle_error|422] [/Users/username/git/supervisor/supervisor/medusa/asyncore_25.py|close|361])
Traceback (most recent call last):
File "/Users/username/git/supervisor/supervisor/medusa/asyncore_25.py", line 347, in recv
self.handle_close()
File "/Users/username/git/supervisor/supervisor/medusa/asynchat_25.py", line 156, in handle_close
self.close()
File "/Users/username/git/supervisor/supervisor/medusa/asyncore_25.py", line 361, in close
self.socket.shutdown(socket.SHUT_RDWR)
OSError: [Errno 57] Socket is not connected
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/Users/username/git/supervisor/supervisor/medusa/asynchat_25.py", line 89, in handle_read
data = self.recv (self.ac_in_buffer_size)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/username/git/supervisor/supervisor/medusa/http_server.py", line 528, in recv
result = asynchat.async_chat.recv (self, buffer_size)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/username/git/supervisor/supervisor/medusa/asyncore_25.py", line 354, in recv
self.handle_close()
File "/Users/username/git/supervisor/supervisor/medusa/asynchat_25.py", line 156, in handle_close
self.close()
File "/Users/username/git/supervisor/supervisor/medusa/asyncore_25.py", line 361, in close
self.socket.shutdown(socket.SHUT_RDWR)
OSError: [Errno 57] Socket is not connected
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/Users/username/git/supervisor/supervisor/supervisord.py", line 218, in runforever
dispatcher.handle_read_event()
File "/Users/username/git/supervisor/supervisor/medusa/asyncore_25.py", line 392, in handle_read_event
self.handle_read()
File "/Users/username/git/supervisor/supervisor/medusa/asynchat_25.py", line 91, in handle_read
self.handle_error()
File "/Users/username/git/supervisor/supervisor/medusa/http_server.py", line 546, in handle_error
asynchat.async_chat.handle_error (self)
File "/Users/username/git/supervisor/supervisor/medusa/asyncore_25.py", line 422, in handle_error
self.close()
File "/Users/username/git/supervisor/supervisor/medusa/asyncore_25.py", line 361, in close
self.socket.shutdown(socket.SHUT_RDWR)
OSError: [Errno 57] Socket is not connected
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/opt/homebrew/bin/supervisord", line 33, in <module>
sys.exit(load_entry_point('supervisor', 'console_scripts', 'supervisord')())
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/username/git/supervisor/supervisor/supervisord.py", line 373, in main
go(options)
File "/Users/username/git/supervisor/supervisor/supervisord.py", line 383, in go
d.main()
File "/Users/username/git/supervisor/supervisor/supervisord.py", line 78, in main
self.run()
File "/Users/username/git/supervisor/supervisor/supervisord.py", line 94, in run
self.runforever()
File "/Users/username/git/supervisor/supervisor/supervisord.py", line 224, in runforever
combined_map[fd].handle_error()
File "/Users/username/git/supervisor/supervisor/medusa/http_server.py", line 546, in handle_error
asynchat.async_chat.handle_error (self)
File "/Users/username/git/supervisor/supervisor/medusa/asyncore_25.py", line 422, in handle_error
self.close()
File "/Users/username/git/supervisor/supervisor/medusa/asyncore_25.py", line 361, in close
self.socket.shutdown(socket.SHUT_RDWR)
OSError: [Errno 57] Socket is not connected
```1 parent 4c845a3 commit 9ee5fee
File tree
3 files changed
+51
-2
lines changed- supervisor
- medusa
- tests
- fixtures
3 files changed
+51
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
358 | 358 | | |
359 | 359 | | |
360 | 360 | | |
361 | | - | |
362 | | - | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
363 | 371 | | |
364 | 372 | | |
365 | 373 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
426 | 426 | | |
427 | 427 | | |
428 | 428 | | |
| 429 | + | |
| 430 | + | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
| 434 | + | |
| 435 | + | |
| 436 | + | |
| 437 | + | |
| 438 | + | |
| 439 | + | |
| 440 | + | |
| 441 | + | |
| 442 | + | |
| 443 | + | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
0 commit comments