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

Using thread pool to transform records #9

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Using thread pool to transform records #9

wants to merge 2 commits into from

Conversation

allenwq
Copy link
Contributor

@allenwq allenwq commented Apr 15, 2016

Pending to add README..

@allenwq
Copy link
Contributor Author

allenwq commented Apr 15, 2016

@lowjoel No idea why I get No connection pool for ActiveRecord::Base (ActiveRecord::ConnectionNotEstablished) in travis, it was fine in my local.

class << self
# Store the block if a block is given, otherwise the stored block will be returned.
def around_job(&block)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would define these outside the self singleton class, to be consistent with transform_table

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also, should around_job be composable? Multiple around_job should cause it to chain?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can't think of a use case for multiple around jobs ><

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, but that's the behaviour expected of most Ruby around_X callbacks.

@allenwq
Copy link
Contributor Author

allenwq commented Apr 28, 2016

@lowjoel I tried included a Gemfile.lock (make sure travis uses the same gems as my local) and change the ruby versions, all does not work very well...

@lowjoel
Copy link
Owner

lowjoel commented Apr 28, 2016

@allenwq gemfile.lock doesn't affect gems, so that won't work. What are you trying to achieve?

@allenwq
Copy link
Contributor Author

allenwq commented Apr 28, 2016

It affects the gems install on travis for testing right ?

@lowjoel
Copy link
Owner

lowjoel commented Apr 28, 2016

Yes, but what's the problem you're trying to solve?

@allenwq
Copy link
Contributor Author

allenwq commented Apr 28, 2016

Oh, Tests passed on my local, but cannot even run on travis

@lowjoel
Copy link
Owner

lowjoel commented Apr 28, 2016

I don't think it's a gem version problem. Have you tried with a linux VM?

@allenwq
Copy link
Contributor Author

allenwq commented Apr 28, 2016

...master fails on my linux server > <

@allenwq
Copy link
Contributor Author

allenwq commented Apr 28, 2016

So it's not my PR breaks the travis, @lowjoel can you verify ?

@lowjoel
Copy link
Owner

lowjoel commented Apr 28, 2016

@allenwq https://travis-ci.org/lowjoel/database_transform/builds/126300182, just committed 2 hours ago, finished running 1 minute ago...

@allenwq
Copy link
Contributor Author

allenwq commented Apr 28, 2016

Sorry, I was using the wrong master > <

But now I can get it fail locally, will debug and get back to you.

@lowjoel
Copy link
Owner

lowjoel commented Apr 28, 2016

Thanks! I wanted to try but my VirtualBox VM can't get internet...

@allenwq
Copy link
Contributor Author

allenwq commented Apr 28, 2016

Wait.. even I changed the master it's still failing, I was in commit a913457

ruby 2.3.0p0 (2015-12-25 revision 53290) [x86_64-linux]

/home/allen/.rvm/gems/ruby-2.3.0/gems/activerecord-4.2.6/lib/active_record/connection_adapters/abstract/connection_pool.rb:570:in `retrieve_connection': No connection pool for ActiveRecord::Base (ActiveRecord::ConnectionNotEstablished)
    from /home/allen/.rvm/gems/ruby-2.3.0/gems/activerecord-4.2.6/lib/active_record/connection_handling.rb:113:in `retrieve_connection'
    from /home/allen/.rvm/gems/ruby-2.3.0/gems/activerecord-4.2.6/lib/active_record/connection_handling.rb:87:in `connection'
    from /home/allen/ruby-dev/database_transform/spec/support/sample_database.rb:37:in `<class:Base>'
    from /home/allen/ruby-dev/database_transform/spec/support/sample_database.rb:36:in `block in <top (required)>'
    from /home/allen/.rvm/gems/ruby-2.3.0/gems/rspec-core-3.4.4/lib/rspec/core.rb:97:in `configure'
    from /home/allen/ruby-dev/database_transform/spec/support/sample_database.rb:1:in `<top (required)>'
    from /home/allen/ruby-dev/database_transform/spec/spec_helper.rb:9:in `require'
    from /home/allen/ruby-dev/database_transform/spec/spec_helper.rb:9:in `block in <top (required)>'

It's weird that your commit passes travis and it fails on my linux with the same exception as my PR.

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.

2 participants