Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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 ```
- Loading branch information