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

Bug Report for JRuby: Fiber#new still creates new Threads #21

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

joebew42
Copy link

@joebew42 joebew42 commented Oct 26, 2021

Hello everyone 👋 ,

Unfortunately there still no solution for jruby/jruby#1169, and we still need the workaround that was removed here 0ec3be3.

This PR is for the sole purpose of demonstrating the issue by providing a working example that can be run locally. It's not meant to be merged. If we agree on re-enabling the workaround 0ec3be3, we can merge the fix proposed in a separate PR #22, and then close this one.

What do you think?

Steps to reproduce the issue

Using CRuby 2.7.2

asdf local use ruby 2.7.2
ruby --version
ruby 2.7.2p137 (2020-10-01 revision 5445e04352) [x86_64-darwin19]

Setup and run tests without jdbc

bundle install --with development --with cruby_only
bundle exec rspec --tag ~with_jdbc

Everything is working! 👏

Using JRuby 9.2.19 with OpenJDK 13

asdf local ruby jruby-9.2.19.0
ruby --version
jruby 9.2.19.0 (2.5.8) 2021-06-15 55810c552b OpenJDK 64-Bit Server VM 13+33 on 13+33 +jit [darwin-x86_64]

Setup and run tests with jdbc only

bundle install --with development --without cruby_only
bundle exec rspec --tag with_jdbc

Database transactions are not getting rolled back using #start, and #end

Failures:

  1) DatabaseCleaner::Sequel::Transaction using a postgres connection cleaning should clean database
     Failure/Error: expect(connection[:users]).to be_empty
       expected `#<Sequel::JDBC::Postgres::Dataset: "SELECT * FROM \"users\"">.empty?` to be truthy, got false
     # ./spec/database_cleaner/sequel/jdbc_transaction_spec.rb:48:in `block in Sequel'
     # ./spec/database_cleaner/sequel/jdbc_transaction_spec.rb:33:in `block in Sequel'

  2) DatabaseCleaner::Sequel::Transaction using a postgres connection cleaning should work with nested transaction
     Failure/Error: expect(connection[:users]).to be_empty
       expected `#<Sequel::JDBC::Postgres::Dataset: "SELECT * FROM \"users\"">.empty?` to be truthy, got false
     # ./spec/database_cleaner/sequel/jdbc_transaction_spec.rb:68:in `block in Sequel'
     # ./spec/database_cleaner/sequel/jdbc_transaction_spec.rb:33:in `block in Sequel'

  3) DatabaseCleaner::Sequel::Transaction using a postgres connection start/clean should clean database
     Failure/Error: expect(connection[:users]).to be_empty
       expected `#<Sequel::JDBC::Postgres::Dataset: "SELECT * FROM \"users\"">.empty?` to be truthy, got false
     # ./spec/database_cleaner/sequel/jdbc_transaction_spec.rb:81:in `block in Sequel'
     # ./spec/database_cleaner/sequel/jdbc_transaction_spec.rb:33:in `block in Sequel'

  4) DatabaseCleaner::Sequel::Transaction using a postgres connection start/clean should work with nested transaction
     Failure/Error: expect(connection[:users]).to be_empty
       expected `#<Sequel::JDBC::Postgres::Dataset: "SELECT * FROM \"users\"">.empty?` to be truthy, got false
     # ./spec/database_cleaner/sequel/jdbc_transaction_spec.rb:102:in `block in Sequel'
     # ./spec/database_cleaner/sequel/jdbc_transaction_spec.rb:33:in `block in Sequel'

Notes

@joebew42 joebew42 changed the title JRuby: Fiber#new still creates threads Bug Report for JRuby: Fiber#new still creates threads Oct 26, 2021
@joebew42 joebew42 changed the title Bug Report for JRuby: Fiber#new still creates threads Bug Report for JRuby: Fiber#new still creates new threads Oct 26, 2021
@joebew42 joebew42 changed the title Bug Report for JRuby: Fiber#new still creates new threads Bug Report for JRuby: Fiber#new still creates new Threads Oct 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant