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-3665 SingleFileStore is not thread-safe for passivation #2180
Conversation
<xs:attribute name="fsyncMode" type="tns:fsyncMode" default="DEFAULT"> | ||
<xs:annotation> | ||
<xs:documentation> | ||
Configures how the file changes will be synchronized with the underlying file system. This property has three possible values (The default mode configured is DEFAULT) |
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.
This needs to be updated to be 2 instead of 3.
The PR should also include the test. |
@danberindei I've rewritten the fix to address the underlying thread-safety issue, rather than working around it via forcing disk syncing. I've also included the test that reproduced the issue and validates the fix. |
@pferraro test is failing on my machine https://gist.github.com/mmarkus/7352945 |
I see the problem. Another thread can still modify the file entry after FileEntry.waitUnlocked() succeeds. So the waitUnlocked() AND file entry invalidation needs to happen while holding the fileList monitor. |
Looking closer this is a bit more complicated. I just created https://issues.jboss.org/browse/ISPN-3693 which is probably causing quite a bit of confusion as there is an issue with concurrent get and evicts with passivation when eviction is done manually. Basically it can cause the entry to be lost in that it is neither in the data container or in the store. Once that is fixed this should probably be revisited. |
I'm not denying that there aren't other issues with eviction, but nevertheless ISPN-3693 doesn't invalidate this fix. |
@pferraro Oh don't get me wrong, I wasn't trying to say this fix was not needed. I was just saying that there are other issues other than just the SingleFileStore and the test you provided will not work properly unless ISPN-3693 is fixed as well. And I totally agree that SingleFileStore should be revisited to be even more thread safe than it is atm 👍 |
@mmarkus Is this test still failing for you? I've run in many times in a row with 100% success. |
@pferraro I have finally managed to reproduce a failure with a test that doesn't involve the ActivationInterceptor, and it looks like the fix here is not sufficient. What happens is that @wburns Do you still need Paul's test for PR #2203? If possible, I'd prefer a test that uses |
@danberindei Thanks for looking into this. I suggest replacing the keyLen, dataLen, and metadataLen with a volatile reference to an immutable object. It would help improve the throughput of the store, I think, if concurrent readers didn't have to sync on the same monitor to guarantee thread-safe access to these values. |
@danberindei Created https://issues.jboss.org/browse/ISPN-3699 to cover the tests for the other changes since this PR is closed now. |
No description provided.