Replies: 3 comments 7 replies
-
This shouldn't happen. As you pointed out, Sequel already checks If this is reproducible on JRuby 9.4 but not on JRuby 9.3, with the same Sequel version, I would suspect a bug in JRuby. If you have an self-contained example that reproduces for you, I'll definitely examine it and see if I can reproduce the issue. If this is an issue with Sequel, be assured it will be fixed with the highest priority. |
Beta Was this translation helpful? Give feedback.
-
There is an open issue where the JRuby's database connection object wasn't considered identical with itself. So, when Sequel started using Anyway, I just wanted to post it here in case it's a possible lead. I would recommend at least trying to turn off DB.instance_variable_set(:@transactions, {}) |
Beta Was this translation helpful? Give feedback.
-
It looks like this is coming from our test fixtures which kill any background threads after the test has completed. When these background threads are running queries with Sequel, this can result in the internal state being corrupted. Since Thread.kill is generally discouraged, I don't expect this to be fully robust in the face of this behavior, but I did find a couple places where global state is temporarily inconsistent and can lead to problems if interrupted before it can sync itself up again. The first is here: https://github.com/jeremyevans/sequel/blob/5.86.0/lib/sequel/database/transactions.rb#L455-L459 This causes the originally reported issue. The second is here: https://github.com/jeremyevans/sequel/blob/5.86.0/lib/sequel/connection_pool/threaded.rb#L212 In this case, the It appears that both of these could be mitigated, and I was able to improve the robustness of my test case by tweaking them, but I wasn't sure if there were any unintended side effects from the changes. So just reporting the details here for your information in case you want to address them. |
Beta Was this translation helpful? Give feedback.
-
I'm working on a large project which is upgrading from JRuby 9.3 to 9.4. We are seeing some unexpected test failures and I'm trying to determine whether they are an issue with JRuby or Sequel, and also what sort of scenarios could lead to the result we're seeing.
The error we're getting is
Looking at the source, it doesn't appear like this should be a valid state for Sequel to get into. Either
_conn(trans)
is nil, which shouldn't be because we've already checkedalready_in_transaction?
, or the list of savepoints is empty. The second doesn't seem possible based on my reading, but is harder to verify.Do you have any insight as to whether this is a legit bug in Sequel (eg. empty savepoints list due to missed locking or incorrect error handling) or might we be looking at a JRuby issue, since we didn't see this before upgrading to 9.4. We thought this might be related to jruby/jruby#8585, but we're testing with the latest version which includes a fix for this issue.
Beta Was this translation helpful? Give feedback.
All reactions