-
Notifications
You must be signed in to change notification settings - Fork 51
Client does not shut down properly when cluster connection attempts all fail #285
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 FAILed. |
|
verify |
|
Test FAILed. |
1 similar comment
|
Test FAILed. |
|
Test FAILed. |
1 similar comment
|
Test FAILed. |
|
verify |
|
Test FAILed. |
|
verify |
|
Test FAILed. |
|
verify |
|
Test FAILed. |
|
Test FAILed. |
1 similar comment
|
Test FAILed. |
|
Test FAILed. |
…ttempts all fail. The Thread join now will detect if it is being called from running thread and avoid deadlock. Removed the unneded test testTcpSocketConnectionTimeout_withIntMax. Added some additional tests for testing thread functionality.
…ava client. Corrected what is being tested at IssueTest.issue221.
…o this causes invalid memory access since the client is destroyed and all its services are destroyed.
… wakeup socket is not initialized yet.
|
Test FAILed. |
|
Test FAILed. |
…zelcastClient destructor.
|
Test PASSed. |
|
I did not get why shutdown needs a countdown latch to wait. I am trying to understand if this is a problem we need to solve, or is it just a illegal usage. |
|
@sancar Yes, that is exactly the case. I saw it test https://github.com/hazelcast/hazelcast-cpp-client/blob/master/hazelcast/test/src/cluster/ClientConnectionTest.cpp#L48 So, the test finishes and hence the client destructor is executed before the shutdown is actually completed and hence during the shutdown illegal memory access occurs. I don't think it is an illegal use. Yes, java uses shared references which eliminates the problem. It may also be solved by keeping an internally shared pointer and just returning a wrapper object HazelcastClient to the user, and also keeping a reference inside the clientcontext object which is being used between the threads. In any case, we need to guarantee that the shutdown is finished and all threads are closed before exiting the destructor. |
|
I still don't get it. How is the HazelcastClient shared between two threads in this test? If it is a raw pointer and one is calling destructor. This usage is illegal. |
|
@sancar Scenario: ClusterListenerThread at this line: https://github.com/ihsandemir/hazelcast-cpp-client/blob/shutdownFix/hazelcast/src/hazelcast/client/connection/ClusterListenerThread.cpp#L88 But I think I can also fix it by changing the lines 87 and 88 https://github.com/ihsandemir/hazelcast-cpp-client/blob/shutdownFix/hazelcast/src/hazelcast/client/connection/ClusterListenerThread.cpp#L87 . |
|
Test FAILed. |
…titionService was hung indefinitely on shutdown, could not regenerate the problem locally but this may be possible reason. Failing to shutdown the connection means any waiting invocation may not be set and if partition service is waiting on future.get, it may block indefinitely.
|
Test PASSed. |
|
Test PASSed. |
|
Test PASSed. |
Fix for shutting down the client properly if the cluster connection attempts all fail.