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

Remove legacy Rails and Rubies #366

Merged
merged 32 commits into from
Aug 31, 2017
Merged

Conversation

aried3r
Copy link
Member

@aried3r aried3r commented Jun 26, 2017

I think even though this gem is kinda-sorta unmaintained (as in, there are no new releases), I think it's time we clean up some stuff.

Things I want to try to do for rpush "4.0" (or 3.0, if we want to add breaking changes there, but I think a lot of people are already using the master branch):

  • Only support Rails 4.2+
  • Only support Ruby 2.2+
  • Drop JRuby support (debatable, it's just that the test always fail, so I have little confidence in it)
  • Add Appraisals or another way of testing different Rails versions

I'm open for discussion!

Fixes #364

@aried3r aried3r closed this Jun 26, 2017
@aried3r
Copy link
Member Author

aried3r commented Jun 26, 2017

Whoops, accidentally closed it

@aried3r aried3r reopened this Jun 26, 2017
@aried3r
Copy link
Member Author

aried3r commented Jun 27, 2017

Currently requiring the whole of Rails to get the tests running. But I think it would be possible to reduce it to active support and active record maybe. First I want a green test run on at least all the active record tests.

I'm not really sure how to tackle the mongoid and redis tests atm. never used those with rpush.

@aried3r
Copy link
Member Author

aried3r commented Jun 28, 2017

I can't seem to get rpush to work with mongoid for now. Since rpush-mongoid 0.1.0 and 0.2.0 both depend on mongoid versions that do not support Rails 5.x (rather, ActiveModel) I can't seem to get the tests to work.
For example, mongoid 6.2 requires and supports Rails 5.1 https://github.com/mongodb/mongoid/releases/tag/v6.2.0 (actually just actionpack and activemodel)

I'm not sure if the tests heavily depend on Rails in a way that would make them fail, but even now the tests for Rails 4.2 fail. Anyone using rpush-mongoid who can chime in? To use mongoid 5 in the tests we'd have to split the mongoid.yml into two versions because mongoid 5 changed the config file format. For 6 I don't know what is required.

I guess requiring Rails for all the tests makes no sense, so I guess I'd have to split the gemfiles even further in the sense that there'll be "mongoid" gemfiles and "regular" ones.

Otherwise, since we cannot support MongoDB because of rpush-mongoid I'm in favor of dropping support until someone can add support again. That's really harsh, but I'd rather move forward and add support again.
It seems that compared to rpush download numbers rpush-mongoid download numbers are very low.

@aried3r aried3r merged commit 2fa09cc into rpush:master Aug 31, 2017
@aried3r aried3r deleted the ar/remove_legacy_rails branch August 31, 2017 11:27
@Fivell
Copy link
Contributor

Fivell commented Aug 31, 2017

@aried3r nice! any plans to release this to rubygems ?

@aried3r
Copy link
Member Author

aried3r commented Aug 31, 2017

@Fivell
Copy link
Contributor

Fivell commented Sep 7, 2017

@aried3r , FYI after update rails we have strange error in our specs

Called from /Users/igor/.rvm/gems/ruby-2.3.1/gems/activesupport-5.0.6.rc1/lib/active_support/dependencies.rb:259:in `load_dependency'
[2017-09-07 11:52:42] [rpush] [ERROR] ActiveRecord::ActiveRecordError, Cannot expire connection, it is owned by a different thread: #<Thread:0x007fc0d287f448>. Current thread: #<Thread:0x007fc0dfb26d38>.
/Users/igor/.rvm/gems/ruby-2.3.1/gems/activerecord-5.0.6.rc1/lib/active_record/connection_adapters/abstract_adapter.rb:189:in `expire'
/Users/igor/.rvm/gems/ruby-2.3.1/gems/activerecord-5.0.6.rc1/lib/active_record/connection_adapters/abstract/connection_pool.rb:503:in `block (2 levels) in checkin'
/Users/igor/.rvm/gems/ruby-2.3.1/gems/activesupport-5.0.6.rc1/lib/active_support/callbacks.rb:126:in `call'
/Users/igor/.rvm/gems/ruby-2.3.1/gems/activesupport-5.0.6.rc1/lib/active_support/callbacks.rb:506:in `block (2 levels) in compile'
/Users/igor/.rvm/gems/ruby-2.3.1/gems/activesupport-5.0.6.rc1/lib/active_support/callbacks.rb:455:in `call'
/Users/igor/.rvm/gems/ruby-2.3.1/gems/activesupport-5.0.6.rc1/lib/active_support/callbacks.rb:101:in `__run_callbacks__'
/Users/igor/.rvm/gems/ruby-2.3.1/gems/activesupport-5.0.6.rc1/lib/active_support/callbacks.rb:750:in `_run_checkin_callbacks'
/Users/igor/.rvm/gems/ruby-2.3.1/gems/activerecord-5.0.6.rc1/lib/active_record/connection_adapters/abstract/connection_pool.rb:502:in `block in checkin'
/Users/igor/.rvm/rubies/ruby-2.3.1/lib/ruby/2.3.0/monitor.rb:214:in `mon_synchronize'
/Users/igor/.rvm/gems/ruby-2.3.1/gems/activerecord-5.0.6.rc1/lib/active_record/connection_adapters/abstract/connection_pool.rb:499:in `checkin'
/Users/igor/.rvm/gems/ruby-2.3.1/gems/activerecord-5.0.6.rc1/lib/active_record/connection_adapters/abstract_adapter.rb:459:in `close'
/Users/igor/.rvm/gems/ruby-2.3.1@global/gems/connection_pool-2.2.1/lib/connection_pool.rb:144:in `block in method_missing'
/Users/igor/.rvm/gems/ruby-2.3.1@global/gems/connection_pool-2.2.1/lib/connection_pool.rb:64:in `block (2 levels) in with'
/Users/igor/.rvm/gems/ruby-2.3.1@global/gems/connection_pool-2.2.1/lib/connection_pool.rb:63:in `handle_interrupt'
/Users/igor/.rvm/gems/ruby-2.3.1@global/gems/connection_pool-2.2.1/lib/connection_pool.rb:63:in `block in with'
/Users/igor/.rvm/gems/ruby-2.3.1@global/gems/connection_pool-2.2.1/lib/connection_pool.rb:60:in `handle_interrupt'
/Users/igor/.rvm/gems/ruby-2.3.1@global/gems/connection_pool-2.2.1/lib/connection_pool.rb:60:in `with'
/Users/igor/.rvm/gems/ruby-2.3.1@global/gems/connection_pool-2.2.1/lib/connection_pool.rb:131:in `with'
/Users/igor/.rvm/gems/ruby-2.3.1@global/gems/connection_pool-2.2.1/lib/connection_pool.rb:143:in `method_missing'
/Users/igor/.rvm/gems/ruby-2.3.1/bundler/gems/rpush-2bf846a4d0e4/lib/rpush/daemon/store/active_record.rb:164:in `release_connection'
/Users/igor/.rvm/gems/ruby-2.3.1/bundler/gems/rpush-2bf846a4d0e4/lib/rpush/daemon/feeder.rb:12:in `block in start'

@aried3r
Copy link
Member Author

aried3r commented Sep 7, 2017

Hmm, I already run rpush 3.0.0 RC1 in production since yesterday after testing for a week in staging. However with Rails 5.0.5, not 5.0.6 RC1.

Do you actively run rpush in the specs or just check if there's new notifications in the database? Because I only test for that, without actually running rpush (since there's no dry-run implemented yet).

@Fivell
Copy link
Contributor

Fivell commented Sep 7, 2017

@aried3r this can be miss-configuration in our test environment. We found out that this patch resolves this error

require 'rpush'
require 'rpush/daemon/store/interface'
require 'rpush/daemon/store/active_record'
module Rpush
  module Daemon
    module Store
      class ActiveRecord
        def release_connection
         # ::ActiveRecord::Base.connection.close
           ::ActiveRecord::Base.connection_pool.release_connection
        rescue StandardError => e
          Rpush.logger.error(e)
        end
      end
    end
  end

Did you have any issues when stop / restart rpush daemon ?

@Fivell
Copy link
Contributor

Fivell commented Sep 7, 2017

btw ::ActiveRecord::Base.connection.close was introduced here 5653cab#diff-8c805eff0bcb8b533ecd802f81287ce1L149

@aried3r
Copy link
Member Author

aried3r commented Sep 7, 2017

Just tried on our staging server. Stopping, starting etc is no problem using 3.0.0.rc1.

That change is three years old and seems not to have been touched since then https://github.com/rpush/rpush/blob/v3.0.0.rc1/lib/rpush/daemon/store/active_record.rb#L164

Can you make sure you're running 3.0.0.rc1? (I see you're pointing to master, which should be the same right now). But I had to shutdown rpush and start it back up again so the daemon used the latest version of rpush. (On that note, rpush status should probably output the rpush version)

I'm afraid I can't really help in this case. It's a Works on my machine!™ type-a-deal :D

But feel free to open a new issue, this PR might not be the best place for others to see.

I also plan to roll out the RC1 as a stable version by next week (wanna test in production some more) so more users will probably update and report bugs (which I hope there aren't any).

@Fivell
Copy link
Contributor

Fivell commented Sep 7, 2017

@aried3r works for me as well, this lines just logged to log file.
Yes it is 3.0.0.rc1

refs https://github.com/rails/rails/pull/14938/files#diff-c226a4680f86689c3c170d4bc5911e96R149

@venriq
Copy link

venriq commented Oct 11, 2017

@aried3r I'm a heavy rpush-mongoid user. I can take a look at the gem and update the dependencies. Any specifications in particular?

@aried3r
Copy link
Member Author

aried3r commented Oct 14, 2017

@venriq, feel free to submit PRs to rpush-mongoid as well as rpush.

See also f1eb5b4 where I removed all of the code that was there before.

Adrian1707 pushed a commit to Adrian1707/rpush that referenced this pull request Apr 24, 2024
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.

None yet

3 participants