mperham / connection_pool

Generic connection pooling for Ruby
MIT License
1.63k stars 143 forks source link

As of v2.2.3 it breaks with ruby < 2.0.0 #133

Closed amuta closed 3 years ago

amuta commented 4 years ago

Within the v.2.2.3 release, the removal of the line if Thread.respond_to?(:handle_interrupt) from lib/connection_pool.rb will cause the NoMethodError for ruby versions before 2.0.0.

The commit that caused this behavior 5f72d5372f88b5ac696904009b01afe70feede64 at line 57

It breaks because the handle_interrupt was added (renamed from another method actually) to the Thread class only in the 2.0.0 release, see it here

  • thread.c: rename methods: from Thread.async_interrupt_timing to Thread.handle_interrupt,

I think the main problem is that the gemspec does not say anything about not supporting projects with older ruby versions which would prevent the gem to update from such projects.

mperham commented 4 years ago

So send a PR to fix it? I'm ok with Ruby 2.2+.

mayrsascha commented 4 years ago

@mperham I guess it would be a good idea then to specify the required ruby version for this gem? There is a required_ruby_version configuration option for the Gemspec, that will give people trying to install it with a lower Ruby version an error when they try to install it. If you agree with me let me know and I'll open a PR.

mperham commented 4 years ago

Great idea.

On Tue, Oct 20, 2020 at 06:22 mayrsascha notifications@github.com wrote:

@mperham https://github.com/mperham I guess it would be a good idea then to specify the required ruby version for this gem? There is a required_ruby_version configuration option for the Gemspec https://guides.rubygems.org/specification-reference/#required_ruby_version, that will give people trying to install it with a lower Ruby version an error when they try to install it. If you agree with me let me know and I'll open a PR.

— You are receiving this because you were mentioned.

Reply to this email directly, view it on GitHub https://github.com/mperham/connection_pool/issues/133#issuecomment-712845727, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAAAWX3NORZ2V4HF2M4RQATSLWFJRANCNFSM4PVOEJSQ .