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

Fix Travis Jruby job error #58

Merged
merged 1 commit into from
Aug 30, 2018
Merged

Fix Travis Jruby job error #58

merged 1 commit into from
Aug 30, 2018

Conversation

dks17
Copy link
Collaborator

@dks17 dks17 commented Aug 30, 2018

I would like fix Travis Jruby job which was broken in #55

Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

Also I added two small changes:

Does actually bundler need in Gemfile?

gem 'bundler', '~> 1.1'

I think it is actually does't matter.
Value of what variable we should check retry_sleep or opts[:retry_sleep]?

retry_sleep = opts[:retry_sleep]
# code
if attempts_left > 0
  # if not passed a retry_sleep value, we sleep for the remaining life of the lock
  unless opts[:retry_sleep] # <==
    locked_until = Mongoid::Locker::Wrapper.locked_until(self)

@mongoid-bot
Copy link

1 Warning
⚠️ Unless you’re refactoring existing code, please update CHANGELOG.md.

Here's an example of a CHANGELOG.md entry:

* [#58](https://github.com/mongoid/mongoid-locker/pull/58): Fix travis jruby job error - [@dks17](https://github.com/dks17).

Generated by 🚫 danger

@@ -170,7 +170,7 @@ def lock(opts = {})

if attempts_left > 0
# if not passed a retry_sleep value, we sleep for the remaining life of the lock
unless opts[:retry_sleep]
unless retry_sleep
Copy link
Collaborator

Choose a reason for hiding this comment

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

This technically doesn't matter, but the change is intentionally correct.

@dblock dblock merged commit af5ccec into mongoid:master Aug 30, 2018
@dblock
Copy link
Collaborator

dblock commented Aug 30, 2018

Merged. Do you want to add a specific JRuby version to the build matrix that's not allowed to fail? PR.

@dks17
Copy link
Collaborator Author

dks17 commented Aug 30, 2018

Merged. Do you want to add a specific JRuby version to the build matrix that's not allowed to fail? PR.

I just wanted fix one of test for jruby and investigated it. And I know that self.update wrapper method returns false when it should be true. The number of documents updated in the write is 0.

      def self.update(klass, query, setter)
        rc = klass.with(write: { w: 1 }) do
          klass.collection.find(query).update_one(setter)
        end
        rc.ok? && rc.documents.first['n'] == 1
      end

That behaviour might be the reason one of opened issues.

@dks17 dks17 deleted the fix_jruby branch March 24, 2019 12:44
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.

3 participants