You signed in with another tab or window.
Reload
to refresh your session.
You signed out in another tab or window.
Reload
to refresh your session.
You switched accounts on another tab or window.
Reload
to refresh your session.
OSError: [Errno 9] Bad file descriptor
on
socket.shutdown(socket.SHUT_RDWR)
#597
❓
What is the motivation / use case for changing the behavior?
Clean runtime operation.
💡
To Reproduce
Not clear.
💡
Expected behavior
No
exception
logged
.
📋
Details
This is what's visible in the CI log:
> assert c_msg in raw_testing_server.error_log.ignored_msgs, (
'Found error in the error log: '"message = '{c_msg}', level = '{c_level}'\n"'{c_traceback}'.format(**locals()),
E AssertionError: ("Found error in the error log: message = 'Error in HTTPServer.serve', level = '40'
E Traceback (most recent call last)...e_kernel_socket
E shutdown(socket.SHUT_RDWR) # actually send a TCP FIN
E OSError: [Errno 9] Bad file descriptor
E ",)
E assert 'Error in HTTPServer.serve' in []
E + where [] = <cheroot.test.test_conn.ErrorLogMonitor object at 0x10906e4f0>.ignored_msgs
E + where <cheroot.test.test_conn.ErrorLogMonitor object at 0x10906e4f0> = <cheroot.wsgi.Server object at 0x10906ef10>.error_log
It's not clear why exactly this is happening but googling suggests that the underlying syscall is what returns
[Errno 9] Bad file descriptor
.
https://man7.org/linux/man-pages/man2/shutdown.2.html
includes the following:
ERRORS
EBADF
sockfd
is not a valid file descriptor.
Which may mean that the underlying file descriptor for the socket in question may have been closed prior to this call somehow. It's interesting that this error is separate from
I was also concerned by the test in question (
cheroot/test/test_conn.py::test_invalid_selected_connection
) sabotaging the connection influencing this, but couldn't come up with an explanation of how it could damage the underlying kernel socket so it's likely not the cause of this traceback.
Oh.. And there's one more place in Cheroot where the shutdown is called, but it seems like it's happening on the final cleanup, not prior to the shutdown in question:
Metadata
Metadata
Assignees
Labels
Type
Projects
Milestone
Relationships
Development
Issue actions