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

make code compatible with mongo ruby driver >= 2.0.0 #7

Closed

Conversation

thikonom
Copy link

I made some changes to make the code compatible with the new version of the mongo driver (>= 2.0.0).

rescue => e
@logger.warn("Failed to send event to MongoDB", :event => event, :exception => e,
:backtrace => e.backtrace)
if e.error_code == 11000
if e.message =~ /^11000/

Choose a reason for hiding this comment

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

This needs to be /^E11000/

Here's a snippet of the error: :exception=>#<Mongo::Error::OperationFailure: E11000 duplicate key error...

@coreypobrien
Copy link

+1 after the fix for the duplicate key error
I upgraded my mongo driver which hit this bug and caused everything to stop working. This patch got everything back normal.

@thikonom
Copy link
Author

thikonom commented Jun 9, 2015

@coreypobrien thanks for spotting the typo. I'm confused does it work for you or not ?

@coreypobrien
Copy link

Yeah it works for me except for the duplicate record error which just sends things into an infinite loop of retry hell :) Sorry about the confusing comment. I edited it to be clearer

@thikonom
Copy link
Author

No worries mate.
I amended the regex, should be fine now.

@coreypobrien
Copy link

This fixes #3 so we can keep using the latest mongo driver. There is also #8 which pegs the driver to an older version. I'd prefer this fix.

@purbon
Copy link

purbon commented Aug 31, 2015

Thanks a lot for your contribution @thikonom. To be able to go forward with this PR it would be necessary that you sign the CLA (https://www.elastic.co/contributor-agreement).

Looking forward to get this in,

  • purbon

@thikonom
Copy link
Author

Hey @purbon, I just signed it.

@purbon
Copy link

purbon commented Sep 4, 2015

thanks a lot @thikonom, I just merged this PR with #14 where I will focus on bringing this changes all in including adding unit test to the plugin, so I will close this PR for now. Thanks a lot man! much appreciate your contribution.

@purbon purbon closed this Sep 4, 2015
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