-
Notifications
You must be signed in to change notification settings - Fork 60
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
NNG Panic on Python shutdown #108
Comments
I can confirm this bug, with the same setup. |
This is a good find. Thanks for posting the issue, and I think you nailed the problem. I'm not sure the best solution either. A crash is never good. I can't completely remember why we even call
Maybe we could add a global variable to pynng, a bool called Thoughts? |
I think that solution is ok, and having it default to |
I ran into the same bug and wrote a simple repro case. About half the time I get nni logs like OP.
|
I've forked and updated nng (and mbedtls) to the latest version, and the code does not crash anymore. |
We experience (under certain conditions) reproducible crash of python process.
My investigation showed that it is caused by access of
nni_aio_lk
which was deinit'd bynng_fini
/nni_fini
/nni_aio_sys_fini
.nni_aio_sys_fini
is triggered by _pynng_atexit andnni_aio_free
byAIOHelper.__del__
This looks like a timing issue on python shutdown: depending on atexit functions are called and objects garbage collected, it might be possible that nng was already deinitialized and pynng, but pynng is still calling the nng lib
It is currently unclear how best to address this issue. Any ideas?
(for background, this occurs reproducibly in our CI when using pynng 0.7.1, asyncio & pytest, but we did also see it from time to time when running our application on developer machines and stopping the application)
The text was updated successfully, but these errors were encountered: