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

ISPN-9002 LocalModeNoPassivationTest.testValuesWithEvictedEntries random #5957

Merged
merged 1 commit into from May 4, 2018

Conversation

wburns
Copy link
Member

@wburns wburns commented May 3, 2018

failures

  • Fixed issue with retrieval during close

https://issues.jboss.org/browse/ISPN-9002

failures

* Fixed issue with retrieval during close
@wburns
Copy link
Member Author

wburns commented May 3, 2018

This could occur during the following window

  1. iterator thread finds nothing in queue and was about to acquire lock
  2. store thread adds entry to queue and then acquires lock and closes
  3. iterator thread retrieves lock and then sees that it was closed returning null.

@rvansa rvansa merged commit 3853c54 into infinispan:master May 4, 2018
@@ -126,7 +132,7 @@ public void processEntry(MarshalledEntry<K, V> marshalledEntry, AdvancedCacheLoa
closeLock.lock();
try {
// If is possible that someone inserted a value and then acquired the close lock - thus we must recheck
if (closed || (entry = queue.poll()) != null) {
if ((entry = queue.poll()) != null || closed) {
Copy link
Member

Choose a reason for hiding this comment

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

I stared for 5 minutes at this code yesterday without realizing what switching the evaluation order would do...
I saw it when I looked again today, but may I suggest not mixing complex if conditions and assignments? :)

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