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-7097 Fix random failures in FlagsReplicationTest #4606

Closed
wants to merge 1 commit into from

Conversation

rvansa
Copy link
Member

@rvansa rvansa commented Oct 10, 2016

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

Make sure that the CommitThread runs the transaction started in LockingThread.

@danberindei
Copy link
Member

@rvansa I'd like a JIRA, for one I'd like to see an explanation why this doesn't fail every single time :)

@danberindei
Copy link
Member

Looking at the code, I'm not sure why the test is using separate threads at all. haveSecondaryThreadTakeLock could just as well start a tx, acquire the lock, suspend the tx and return it, with haveSecondaryThreadReleaseLock resuming the tx and committing it.

@rvansa
Copy link
Member Author

rvansa commented Oct 10, 2016

@danberindei I think that it does not fail all the time because threads are recycled and there is a good chance that the FJP will assign the operation the same thread. If it does not, there won't be any transaction to commit.
TBH I forgot if I've managed to trace the actual behaviour, I have it in my commit pool for quite some time :) But changing that to single-threaded test makes sense, I'll do that.

@rvansa rvansa changed the title Fix random failures in FlagsReplicationTest ISPN-7097 Fix random failures in FlagsReplicationTest Oct 10, 2016
Use suspend/resume transactions rather than separate threads
@rvansa
Copy link
Member Author

rvansa commented Oct 10, 2016

@danberindei here you come....

@danberindei
Copy link
Member

@rvansa That's why it's good to create a JIRA, it means you have it written down and you don't have to remember everything. E.g. AbstractInfinispanTest.fork() actually uses a ThreadPoolExecutor, not FJP :)

@danberindei
Copy link
Member

Integrated, thanks Radim!

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