-
Notifications
You must be signed in to change notification settings - Fork 727
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
Handle edge case where socket is None #686
Handle edge case where socket is None #686
Conversation
@ralight I've search the issues and see others have reports this issue and stated that calling This might not be to the correct fix, but it fixes it for me and I would assume others as if the Socket is None, there is no connection and the reconnect logic seems to kick in |
169edce
to
b66d28c
Compare
* The following exception happens randomly on startup: ``` Exception has occurred: AttributeError 'NoneType' object has no attribute 'recv' File "paho/mqtt/client.py", line 640, in _sock_recv ``` * The root cause is unknown, but this allows the library to reconnect gracefully. Signed-off-by: Robert DeRose <[email protected]>
7fb6936
to
2338d27
Compare
Would like to see this one on main, had same issue... Still couldn't face the root of cause |
I gave up getting this PR merged. I ended up doing my own thread management Just start your own thread, call |
@ralight Please merge this PR, this caused seriously randomly issues in our production! |
src/paho/mqtt/__init__.py
Outdated
@@ -1,4 +1,4 @@ | |||
__version__ = "1.6.1" | |||
__version__ = "1.6.2" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should not change the version in a PR
Thank for your contribution. As I said in #505, I think the real fix would be to audit concurrency access and improve either locking or improve documentation on what could be called concurrently. In the meantime your fix seems simple and correct the the described problem. |
Fixes #505