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

[API-879] Wait for listener deregistration requests #475

Merged

Conversation

mdumandag
Copy link
Contributor

With this PR, we will wait for all the listener deregistration
requests to finish before returning True to the user.

It is mainly a precaution to the possible problems that might result
in services that expect sync removal of listeners.

While doing that, I have also dived into one of our technical debts
and corrected the implementation of the combine_futures.

It now waits for all futures to complete in all scenarios, as it should be,
and sets the result to the first exceptional completion, if some of
the input futures complete as such.

Closes #448

With this PR, we will wait for all the listener deregistration
requests to finish before returning `True` to the user.

It is mainly a precaution to the possible problems that might result
in services that expect sync removal of listeners.

While doing that, I have also dived into one of our technical debts
and corrected the implementation of the `combine_futures`.

It now waits for all futures to complete in all scenarios, as it should be,
and sets the result to the first exceptional completion, if some of
the input futures complete as such.
Copy link
Contributor

@yemreinci yemreinci left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

combine_futures looks perfect ✔️

deregister_listener seems to follow Java except a small difference.

And I have a small question: We pop from the local registration dictionary _active_registrations before receiving a successful deregistration response from the members. So, can there be an erroneous case where the member still thinks we have a listener registered and keep sending events?

@mdumandag
Copy link
Contributor Author

@yemreinci Yes, correct. I think we discussed this a while ago during one of our standups, discussed various solutions for that problem, and reached this state.

The client always removes its local listener registration, regardless of the listener deregistration request outcome. When a member sends an event that we don't know, we will simply ignore it, but as you said it will keep coming to the client

@mdumandag mdumandag merged commit e9dfb0a into hazelcast:master Sep 16, 2021
@mdumandag mdumandag deleted the wait-for-listener-deregistration branch September 16, 2021 13:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[TRACKING ISSUE] Remove listeners sync with the calling thread
3 participants