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-424] Do not allow concurrent requests on SessionManager for the same group id #904

Merged

Conversation

mdumandag
Copy link
Contributor

@mdumandag mdumandag commented May 20, 2021

We should make sure that for the same group id, new create session requests
should only be made if there is no session or the session is expired.

To achieve this, a new Map that holds the group id to in-flight
create session requests pairs is introduced. When an in-flight request
is found for a group id, concurrent requests now wait for the initial
request to complete (either normally or exceptionally) and then try
again.

Closes #898

We should make sure that for the same group id, new create session requests
should only be made if there is no session or the session is expired.

To achieve this, a new Map that holds the group id to in-flight
create session requests pairs is introduced. When an in-flight request
is found for a group id, concurrent requests now wait for the initial
request to complete (either normally or exceptionally) and then try
again.
Copy link
Member

@srknzl srknzl left a comment

Choose a reason for hiding this comment

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

LGTM! Thanks.

@mdumandag mdumandag merged commit e958f96 into hazelcast:master May 21, 2021
@mdumandag mdumandag deleted the fix-concurrent-new-session-requests branch May 21, 2021 07:47
harunalpak pushed a commit to harunalpak/hazelcast-nodejs-client that referenced this pull request Dec 8, 2022
…same group id (hazelcast#904)

* Do not allow concurrent requests on SessionManager for the same group id

We should make sure that for the same group id, new create session requests
should only be made if there is no session or the session is expired.

To achieve this, a new Map that holds the group id to in-flight
create session requests pairs is introduced. When an in-flight request
is found for a group id, concurrent requests now wait for the initial
request to complete (either normally or exceptionally) and then try
again.

* check the error text in the test
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.

Race condition with locks when a CP session hasn't been issued yet
2 participants