-
Notifications
You must be signed in to change notification settings - Fork 73
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
smbprotocol.transport.Tcp._recv can end up in a dead lock #263
Comments
I have created the issue as a reminder. I will see how I can write an automated tests for this. |
I've been meaning to revamp the whole transport mechanism to work in a more reliable and plugin like way. This would enable transports like Quic and use epoll on platforms that support this. It's been a while since I last played around with it but the WIP code is in the socket-refactor branch. |
Removing the need for threads would be nice. I think that going with asyncio is an excelent first step...and later it should be easy for people to refactor the code for At the same time, I think that it is worth trying to write an automated test for this case. I have observed this issue with my automated tests. The issue is that we have this close,
Which blocks on It also holds the close lock. I have this patch applied to my smbprotocol version, so I would be happy send a PR to fix it , so that I can use vanilla smbprotocol. I will try to find some time to work on this |
That's another use case, unfortunately async is a lot more difficult as you would essentially need to duplicate the rest of the APIs to expose an async one :(
If you are coming across a deadlock and have a fix then yes please a PR would be great. |
Hi. Thanks again for working on smbprotocol.
I have recently start seeing on my Windows tests the overlap of
smbprotocol.tranport.Tcp.close()
withsmbprotocol.tranport.Tcp.recv()
...the issue is thatrecv()
will only free theTcp._close_lock
after a read timeout.I am trying to see how this can be fixed.
One idea is to lock only after the
select()
call.Originally posted by @adiroiban in #80 (comment)
The text was updated successfully, but these errors were encountered: