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

Concurrent access #34

Closed
nikoncode opened this issue Nov 24, 2017 · 3 comments
Closed

Concurrent access #34

nikoncode opened this issue Nov 24, 2017 · 3 comments
Labels
Milestone

Comments

@nikoncode
Copy link

nikoncode commented Nov 24, 2017

I have a lot of concurrent calls inside my application and I receive the following logs:

Nov 24, 2017 6:35:16 AM com.hazelcast.session.HazelcastSessionManager findSession
INFO: No Session found for:ADC7938F491576F2703AFEA344EB0A3F
Nov 24, 2017 6:35:16 AM com.hazelcast.session.HazelcastSessionManager commit
INFO: Thread name:http-bio-8080-exec-7 committed key:ADC7938F491576F2703AFEA344EB0A3F
Nov 24, 2017 6:35:16 AM com.hazelcast.session.HazelcastSessionManager commit
INFO: Thread name:http-bio-8080-exec-6 committed key:ADC7938F491576F2703AFEA344EB0A3F
Nov 24, 2017 6:35:17 AM com.hazelcast.session.HazelcastSessionManager commit
INFO: Thread name:http-bio-8080-exec-6 committed key:ADC7938F491576F2703AFEA344EB0A3F
Nov 24, 2017 6:35:17 AM com.hazelcast.session.HazelcastSessionManager findSession
INFO: No Session found for:ADC7938F491576F2703AFEA344EB0A3F
Nov 24, 2017 6:35:17 AM com.hazelcast.session.HazelcastSessionManager findSession
INFO: No Session found for:ADC7938F491576F2703AFEA344EB0A3F
Nov 24, 2017 6:35:17 AM com.hazelcast.session.HazelcastSessionManager commit
INFO: Thread name:http-bio-8080-exec-3 committed key:ADC7938F491576F2703AFEA344EB0A3F
Nov 24, 2017 6:35:17 AM com.hazelcast.session.HazelcastSessionManager commit
INFO: Thread name:http-bio-8080-exec-1 committed key:ADC7938F491576F2703AFEA344EB0A3F
Nov 24, 2017 6:35:17 AM com.hazelcast.session.HazelcastSessionManager commit
INFO: Thread name:http-bio-8080-exec-7 committed key:ADC7938F491576F2703AFEA344EB0A3F
Nov 24, 2017 6:35:17 AM com.hazelcast.session.HazelcastSessionManager commit
INFO: Thread name:http-bio-8080-exec-6 committed key:ADC7938F491576F2703AFEA344EB0A3F
Nov 24, 2017 6:35:17 AM com.hazelcast.session.HazelcastSessionManager commit
INFO: Thread name:http-bio-8080-exec-7 committed key:ADC7938F491576F2703AFEA344EB0A3F
Nov 24, 2017 6:35:17 AM com.hazelcast.session.HazelcastSessionManager commit
INFO: Thread name:http-bio-8080-exec-6 committed key:ADC7938F491576F2703AFEA344EB0A3F
Nov 24, 2017 6:35:17 AM com.hazelcast.session.HazelcastSessionManager commit
INFO: Thread name:http-bio-8080-exec-6 committed key:ADC7938F491576F2703AFEA344EB0A3F
Nov 24, 2017 6:35:17 AM com.hazelcast.session.HazelcastSessionManager commit
INFO: Thread name:http-bio-8080-exec-7 committed key:ADC7938F491576F2703AFEA344EB0A3F
Nov 24, 2017 6:35:17 AM com.hazelcast.session.HazelcastSessionManager commit
INFO: Thread name:http-bio-8080-exec-7 committed key:ADC7938F491576F2703AFEA344EB0A3F
Nov 24, 2017 6:35:17 AM com.hazelcast.session.HazelcastSessionManager commit
INFO: Thread name:http-bio-8080-exec-7 committed key:ADC7938F491576F2703AFEA344EB0A3F
Nov 24, 2017 6:35:17 AM com.hazelcast.session.HazelcastSessionManager commit
INFO: Thread name:http-bio-8080-exec-1 committed key:ADC7938F491576F2703AFEA344EB0A3F
Nov 24, 2017 6:35:17 AM com.hazelcast.session.HazelcastSessionManager commit
INFO: Thread name:http-bio-8080-exec-7 committed key:ADC7938F491576F2703AFEA344EB0A3F
Nov 24, 2017 6:35:17 AM com.hazelcast.session.HazelcastSessionManager commit
INFO: Thread name:http-bio-8080-exec-3 committed key:ADC7938F491576F2703AFEA344EB0A3F
Nov 24, 2017 6:35:17 AM com.hazelcast.session.HazelcastSessionManager commit
INFO: Thread name:http-bio-8080-exec-3 committed key:ADC7938F491576F2703AFEA344EB0A3F
Nov 24, 2017 6:35:17 AM com.hazelcast.session.HazelcastSessionManager commit
INFO: Thread name:http-bio-8080-exec-7 committed key:ADC7938F491576F2703AFEA344EB0A3F
Nov 24, 2017 6:35:17 AM com.hazelcast.session.HazelcastSessionManager commit
INFO: Thread name:http-bio-8080-exec-6 committed key:ADC7938F491576F2703AFEA344EB0A3F
Nov 24, 2017 6:35:17 AM com.hazelcast.session.HazelcastSessionManager commit
INFO: Thread name:http-bio-8080-exec-6 committed key:ADC7938F491576F2703AFEA344EB0A3F
Nov 24, 2017 6:35:17 AM com.hazelcast.session.HazelcastSessionManager commit
INFO: Thread name:http-bio-8080-exec-6 committed key:ADC7938F491576F2703AFEA344EB0A3F
Nov 24, 2017 6:35:17 AM com.hazelcast.session.HazelcastSessionManager commit
INFO: Thread name:http-bio-8080-exec-6 committed key:ADC7938F491576F2703AFEA344EB0A3F
Nov 24, 2017 6:35:17 AM com.hazelcast.session.HazelcastSessionManager findSession
INFO: No Session found for:ADC7938F491576F2703AFEA344EB0A3F
Nov 24, 2017 6:35:17 AM com.hazelcast.session.HazelcastSessionManager commit
INFO: Thread name:http-bio-8080-exec-7 committed key:ADC7938F491576F2703AFEA344EB0A3F
Nov 24, 2017 6:35:17 AM com.hazelcast.session.HazelcastSessionManager commit
INFO: Thread name:http-bio-8080-exec-3 committed key:ADC7938F491576F2703AFEA344EB0A3F
Nov 24, 2017 6:35:17 AM com.hazelcast.session.HazelcastSessionManager commit
INFO: Thread name:http-bio-8080-exec-6 committed key:ADC7938F491576F2703AFEA344EB0A3F
Nov 24, 2017 6:35:18 AM com.hazelcast.session.HazelcastSessionManager commit
INFO: Thread name:http-bio-8080-exec-3 committed key:ADC7938F491576F2703AFEA344EB0A3F
Nov 24, 2017 6:35:18 AM com.hazelcast.session.HazelcastSessionManager commit
INFO: Thread name:http-bio-8080-exec-3 committed key:ADC7938F491576F2703AFEA344EB0A3F
Nov 24, 2017 6:35:18 AM com.hazelcast.session.HazelcastSessionManager commit
INFO: Thread name:http-bio-8080-exec-7 committed key:ADC7938F491576F2703AFEA344EB0A3F
Nov 24, 2017 6:35:18 AM com.hazelcast.session.HazelcastSessionManager commit
INFO: Thread name:http-bio-8080-exec-3 committed key:ADC7938F491576F2703AFEA344EB0A3F
Nov 24, 2017 6:35:18 AM com.hazelcast.session.HazelcastSessionManager commit
INFO: Thread name:http-bio-8080-exec-6 committed key:ADC7938F491576F2703AFEA344EB0A3F
Nov 24, 2017 6:35:18 AM com.hazelcast.session.HazelcastSessionManager findSession
INFO: No Session found for:ADC7938F491576F2703AFEA344EB0A3F
Nov 24, 2017 6:35:18 AM com.hazelcast.session.HazelcastSessionManager commit
INFO: Thread name:http-bio-8080-exec-3 committed key:ADC7938F491576F2703AFEA344EB0A3F
Nov 24, 2017 6:35:18 AM com.hazelcast.session.HazelcastSessionManager commit
INFO: Thread name:http-bio-8080-exec-6 committed key:ADC7938F491576F2703AFEA344EB0A3F

As you can see I always have the same session id, but for some reason session manager cannot find it.

I think the root cause is the following code:

this.sessionMap.remove(id);
this.sessionMap.set(id, hazelcastSession);

Can somebody explain me why we cannot just execute set without remove to prevent concurrency issue?

If it's required how I can prevent problem like this.

@nikoncode
Copy link
Author

Can we use set without remove or put instead of remove & set operation?

@mesutcelik
Copy link
Contributor

similar to #42

@alparslanavci
Copy link
Contributor

Fixed by #61.

@alparslanavci alparslanavci modified the milestones: 1.2, 1.1.4 Mar 21, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants