-
Notifications
You must be signed in to change notification settings - Fork 37
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
Fixed concurrency issue when finding sessions #99
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added one comment.
@@ -201,7 +201,13 @@ public Session findSession(String id) { | |||
+ "Some failover occurred so reading session from Hazelcast map: " + getMapName()); | |||
} | |||
|
|||
HazelcastSession hazelcastSession = sessionMap.get(id); | |||
HazelcastSession hazelcastSession; | |||
sessionMap.lock(id); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there any significant performance implication of this change?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is difficult to say, but I don't think it will affect that much since only the session removal/update is done within the same synchronised block. This is not a good solution, however we cannot use EntryProcessors or MapInterceptors to handle invalidation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just wonder which one is actually better in terms of performance: having a local cache with all these synchronization work or not having it at all.
@enozcan it might be good to have a benchmark for all session replication options, wdyt? |
Sure! I'm curious about the results especially per module basis for particular scenarios. |
Fixes #84.