Fix incomplete transaction commit when thread is shutdown ungracefully#704
Conversation
|
It seems I need to look into the behaviour of truffleruby as, it seems, it requires special attention |
It seems to be a Truffleruby bug, that blocking IO reverts Thread#status back to "run". So avoid blocking IO, but use Kernel.sleep instead. See here for a similar issue on JRuby: jruby/jruby#4705
d425783 to
2a11006
Compare
larskanis
left a comment
There was a problem hiding this comment.
I added two more commits. Are they OK from your point of view?
I have a concern regarding |
|
I like the new ensure based approach more, since rollback in |
It is. Cool. I just tried to be paranoid about the potential behaviour. I don't have any more remarks. |
|
Thank you @intale for raising this issue and providing fix and test! |
Problem description
Running transactions may suddenly commit when the thread it is running from is force-shutdown.
Steps to reproduce
Refer to the newly added test case
Solution
To fix this we have to additionally check the thread status in
ensureblock and rollback in case we've been interrupted.