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
don't return -1
if the socket was closed
#15771
don't return -1
if the socket was closed
#15771
Conversation
According to
So, I am not sure this PR does the right thing. Returning zero and -1 should both close the socket on our end, it just changes the handling in the code about error conditions and logs. Still, I see in the code that we never actually return zero (EOF). So, we should do something about it. But I am not sure a zero return from @tkatsoulas and @MrZammler please setup a test to see what exactly is happening. If netdata is not cleaning up ssl sockets properly, it is a major problem that needs to be fixed. @ilyam8 this is related to openssl and I know you are trying to trace an SSL related problem when netdata is compiled under muslc. Please check this. Does it improve your situation? |
That's fair. I think the better fix here, at least for problem I'm seeing, would be to add an explicit check for I can update the PR with those changes if you'd like, or I can hold off until further investigation is completed? |
I had the same thought and tried it - it doesn't help. |
@moonbreon yes, this seems more reasonable. And I think it would be immediately mergeable. |
…nly SSL_ERROR_SYSCALL)
@ktsaou - I added an explicit check for zero |
@moonbreon make this little change and this is ready to be merged |
I'm not seeing any change requests? |
Sorry... I didn't finalize the review. |
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.
PR is working as expected. Streaming, Cloud and Exporters had expected results when I connected a child and reboot parent and exporting.
@ktsaou the last commit addressed the issue you raised, when you have a time, please, take a look.
Thank you very much @moonbreon !
Do we need the same change for |
According to the
So, I think is not needed there. |
Merged! Thank you @moonbreon ! |
(cherry picked from commit 43b1a2e)
(cherry picked from commit 43b1a2e)
Summary
SSL_read()
innetdata_ssl_read()
returning 0 bytes is currently being treated as an error, and returning-1
instead. If the connection is closed on the other end, 0 bytes should be returned to the calling method, so the connection is properly closed on both sides.Test Plan
Check that connector response methods now correctly handle a closed socket and don't treat 0 returns bytes as an error case.
Additional Information
For users: How does this change affect me?