Skip to content
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

CANCELING.onCanceled() never triggered when being stopped before connecting #33

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

sam-ma
Copy link

@sam-ma sam-ma commented Aug 24, 2016

Consider the case when TcpTransport.stop() is called just after a TcpTransport.start() call. There is a chance that the socketState becomes CANCELING which is changed by the TcpTransport.stop() call. The following logic would prevent it from connecting and doing any further initialization. In this scenario, the CANCELING.onCanceled() would never be triggered after that, which means the onCompleted Task of the TcpTransport.stop() parameter would never be triggered as well. As a result, the client will wait forever if it relies on the onCompleted Task to be called to proceed.

// No need to complete if we have been canceled.
if( ! socketState.is(CONNECTING.class) ) {
    return;
}

@sam-ma
Copy link
Author

sam-ma commented Aug 25, 2016

I believe AMQ-6405 will be fixed by this pull request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant