-
Notifications
You must be signed in to change notification settings - Fork 51
Client proper shutdown fix (windows) #370
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
Conversation
|
Test PASSed. |
1 similar comment
|
Test PASSed. |
| if (!isJoined) { | ||
| cancel(); | ||
| join(); | ||
| CloseHandle(thread); |
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.
Should not we close the handle if thread is already joined when destructor called ?
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.
If the thread is joined already this means that the above code inside if statement executed, hence the handle is closed. Closing the handle twice it may cause as problem as indicated here: https://msdn.microsoft.com/en-us/library/windows/desktop/ms724211(v=vs.85).aspx
"the function will throw an exception if it receives either a handle value that is not valid or a pseudo-handle value. This can happen if you close a handle twice"
|
Test FAILed. |
af395c8 to
3c38d5a
Compare
|
Test PASSed. |
|
Test FAILed. |
3c38d5a to
c048d8e
Compare
|
Test FAILed. |
1 similar comment
|
Test FAILed. |
9e74037 to
c048d8e
Compare
|
Test FAILed. |
1 similar comment
|
Test FAILed. |
|
Test PASSed. |
1 similar comment
|
Test PASSed. |
… addition to the null check at the ClusterListenerThread thread loop. The problem case: 1. Due to connection reset, the connection is destroyed and the underlying receiveBuffer is deleted. 2. ClusterListenerThread is still at listenMembershipEvents call blocked at the readBlocking call which uses the deleted receiveBuffer of the connection. The receiveBuffer is accessed after the blocking read and this is an illegal memory access.
c048d8e to
2e3326c
Compare
|
Test PASSed. |
1 similar comment
|
Test PASSed. |
Removed connection resets. Added connection alive check to be used in addition to the null check at the ClusterListenerThread thread loop.
The problem case:
fixes #369
Attached is the logs that I added which were used at windows to determine where the problem was.
windows_failure_with_logs_added_issue_369.txt