-
Notifications
You must be signed in to change notification settings - Fork 9
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
Deadlock in paramiko-ng 2.8.10 #145
Comments
This is not a deadlock between 2 threads. The transport thread tried to acquire a channel lock a second time, while holding the logging lock, blocking itself & all other threads trying to log. |
Very interesting ... |
log_to_file() was called by the app to set up paramiko logging to a file. |
I don't think the logger instance was explicitly associated with the channel BufferedFile. It still seems to me like the python GC decided to "free" the BufferedFile at that point in the logging code, causing its destructor method to be called. It has been said to be inadvisable to put any significant logic in destructors, and paramiko channel locking has caused tricky issues before. Anyway, I think the thing to do, is to make the channel close logic detect when it's already closing, and skip it before trying to take that channel lock, in some reasonably elegant way ... |
This problem happens with moderate frequency in our test environment. Every time the stacktrace is the same - happens when handling MSG_CHANNEL_CLOSE. |
Ran into a deadlock issue. We recently switched from paramiko to paramiko-ng. Not sure if the same problem existed before. There were a large number of threads (about 125) using paramiko at the same time.
Almost all the threads using paramiko are stuck at the same place in python logging module as shown below.
The text was updated successfully, but these errors were encountered: