Closed klopfdreh closed 7 months ago
Sonatype Lift will be retiring on Sep 12, 2023, with its analysis stopping on Aug 12, 2023. We understand that this news may come as a disappointment, and Sonatype is committed to helping you transition off it seamlessly. If you’d like to retain your data, please export your issues from the web console. We are extremely grateful and thank you for your support over the years.
Next things to do if this PR is desirable:
FileChannel fileChannel = Mockito.mock(FileChannel.class);
FileLock fileLock = Mockito.mock(FileLock.class);
doThrow(new IOException("First Exception")).doReturn(null).doReturn(fileLock).when(fileChannel).tryLock();
try(MockedConstruction<FileOutputStream> mockedFos = mockConstruction(FileOutputStream.class, (fosMock, context) -> {
doReturn(fileChannel).when(fosMock).getChannel();
})) {
LogFileLock logFileLock = new LogFileLock("/target", "lock.lck");
logFileLock.acquireLock();
verify(fileChannel, times(3)).tryLock();
}
@GuyPardon will this fix be added to the next transactions-essentials release?
@joshuapullin Most likely yes, but can you motivate the reason for retrying? What scenario made it fail before?
Thanks!
I linked the issue with the explanation in the description of this PR.
Integrated for TransactionsEssentials 6.0.1 - with modifications to fit our design direction in the API. Thanks for the good work!
@GuyPardon - I can’t see the changes in the master branch - I hope that there was no issue while integrating the changes.
Note: We saw some race conditions that lead to a StackOverflow. Can you check if all is working properly after integrating my changes and adjusting it to your requirments?
I pushed the changes just now (to GitHub).
So far no issues detected here - would be great if you could test too.
Note: the names of the new properties have changed slightly. See the ConfigProperties class.
Great thanks a lot - I am going to check out and do some retesting. 👍
As promised here are the changes to fix the stack overflow (and an explanation): https://github.com/atomikos/transactions-essentials/pull/207
Fixes: https://github.com/atomikos/transactions-essentials/issues/189