-
-
Notifications
You must be signed in to change notification settings - Fork 396
Try to debug non-closed iopub socket #1345
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
We sometime get
```
FAILED tests/test_connect.py::test_port_bind_failure_gives_up_retries - pytest.PytestUnraisableExceptionWarning: Exception ignored in: <function Socket.__del__ at 0x7efe22e4d760>
Traceback (most recent call last):
File "/opt/hostedtoolcache/Python/3.12.9/x64/lib/python3.12/site-packages/zmq/sugar/socket.py", line 185, in __del__
warn(
ResourceWarning: Unclosed socket <zmq.asyncio.Socket(zmq.PUB) at 0x7efe1eb32820><F48>
```
The only zmq.PUB I can find is iopub, and we don't seem to be closing it
In addition : should app be a contextmanager ?
And should the atexit close registring be replaced with a weakref
finalizer ?
t
|
Ah ! No, in the real application the iopub_socket is closed when you close the thread, but in conftest it is not ! |
|
well, in conf.py it is also closed... |
|
@minrk do you believe that using tracemalloc in the del in pyzmq to print where the socket was created could help and would you accept a PR ? |
|
@Carreau 100%! I thought you had to |
I think you need both ? My understanding is that Maybe I'm wrong. |
|
Seem that you are right it shoudl show up automatically. I will try differently. |
|
Thanks for the review. I'm going to merge and hope it triggers a more helpful error message soon. |
We sometime get
This adds a tracemalloc fixture for the crashing test module in order to try to narrow that down. I'm thorn between restart the tests here until we have the failure; or merge and see once we get the error in another PR and then remove the fixture once we've fund the culprit.
The only zmq.PUB I can find is iopub, and we don't seem to be closing it
In addition : should app be a contextmanager ?
And should the atexit close registring be replaced with a weakref finalizer ?