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

Use string instead of symbol when looking up "failsafe" in payload #951

Conversation

mauro-oto
Copy link
Contributor

@mauro-oto mauro-oto commented Apr 23, 2020

Unlike ActiveJob, Sidekiq doesn't keep symbols in payloads, and converts them
to strings. Because of this, the failsafe mechanism was not working as expected
as it was reported in #950.

This PR fixes that by always looking up 'failsafe' in the payload instead of
:failsafe.

An example of what the payload looks like when logged from Rollbar:

ERROR -- : [Rollbar] Error processing the item: Net::ReadTimeout, Net::ReadTimeout with #<TCPSocket:(closed)>. Item: {"access_token"=>"abcdefghijklmnop", "data"=>{"level"=>"error", "environment"=>"development", "body"=>{"message"=>{"body"=>"Failsafe from rollbar-gem. Net::ReadTimeout: \"Net::ReadTimeout with #<TCPSocket:(closed)>\" in /usr/local/    lib/ruby/2.6.0/net/protocol.rb:217:in `rbuf_fill': error in process_item"}}, "notifier"=>{"name"=>"rollbar-gem", "version"=>"2.24.0"}, "custom"=>{"orig_uuid"=>nil, "orig_host"=>nil}, "internal"=>true, "failsafe"=>true}}

@mauro-oto mauro-oto changed the title Use string instead of symbol when looking it up in payload Use string instead of symbol when looking up "failsafe" in payload Apr 23, 2020
@mauro-oto
Copy link
Contributor Author

@waltjones cherry-picked your commit from #949 to see if it fixes the Travis build here and check whether this PR is passing. I can remove it if you merge that other PR first 👍

@waltjones
Copy link
Contributor

@mauro-oto Thank you for the PR. #949 is merged now.

Unlike ActiveJob, Sidekiq doesn't keep symbols in payloads, and converts them
to strings. Because of this, the failsafe mechanism was not working as expected
and it was reported in rollbar#950.

This PR fixes that by looking up 'failsafe' in the payload instead of :failsafe

An example of what the payload looks like when logged in our logs from Rollbar:

```
ERROR -- : [Rollbar] Error processing the item: Net::ReadTimeout, Net::ReadTimeout with #<TCPSocket:(closed)>. Item: {"access_token"=>"abcdefghijklmnop", "data"=>{"level"=>"error", "environment"=>"development", "body"=>{"message"=>{"body"=>"Failsafe from rollbar-gem. Net::ReadTimeout: \"Net::ReadTimeout with #<TCPSocket:(closed)>\" in /usr/local/lib/ruby/2.6.0/net/protocol.rb:217:in `rbuf_fill': error in process_item"}}, "notifier"=>{"name"=>"rollbar-gem", "version"=>"2.24.0"}, "custom"=>{"orig_uuid"=>nil, "orig_host"=>nil}, "internal"=>true, "failsafe"=>true}}
```
@mauro-oto mauro-oto force-pushed the mo/use-string-for-failsafe-instead-of-symbol branch from c26a192 to 101305b Compare April 23, 2020 15:38
@mauro-oto
Copy link
Contributor Author

@waltjones thanks! just updated this PR to remove the cherry-picked commit from here.

@nijikon
Copy link

nijikon commented Apr 24, 2020

Can this be merged now? I would really want to see a new release with this feature as this is crucial for our use-case.

@mauro-oto
Copy link
Contributor Author

@waltjones any chance you'll merge this today and cut a release? 🙏

@tute
Copy link

tute commented Apr 24, 2020

Please merge soon! This is important for the stability of our production app while using Rollbar. Thank you!

@waltjones
Copy link
Contributor

Yes, if possible this will go out today.

@waltjones waltjones merged commit d9d4056 into rollbar:master Apr 24, 2020
@mauro-oto mauro-oto deleted the mo/use-string-for-failsafe-instead-of-symbol branch April 24, 2020 15:42
@waltjones
Copy link
Contributor

v2.25.0 is released now. https://github.com/rollbar/rollbar-gem/releases/tag/v2.25.0

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.

4 participants