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

React appropriately to HTTP 429 "rate limiting" response code #2

Open
nhooey opened this issue Apr 1, 2016 · 2 comments
Open

React appropriately to HTTP 429 "rate limiting" response code #2

nhooey opened this issue Apr 1, 2016 · 2 comments

Comments

@nhooey
Copy link

nhooey commented Apr 1, 2016

I'm getting an HTTP 429 from HipChat, which the documentation says is rate-limiting. It seems the Sensu plugin doesn't know about this response code:

{
  "timestamp": "2016-04-01T17:20:25.679807+0000",
  "level": "info",
  "message": "handler output",
  "handler": {
    "command": "handler-hipchat.rb",
    "type": "pipe",
    "name": "hipchat"
  },
  "output": [
    "/opt/sensu/embedded/lib/ruby/gems/2.2.0/gems/hipchat-1.5.1/lib/hipchat/room.rb:142:in `send': Unexpected 429 for room `2360342' (HipChat::UnknownResponseCode)
     from /opt/sensu/embedded/lib/ruby/gems/2.2.0/gems/sensu-plugins-hipchat-0.0.3/bin/handler-hipchat.rb:70:in `block in handle'
     from /opt/sensu/embedded/lib/ruby/2.2.0/timeout.rb:88:in `block in timeout'
     from /opt/sensu/embedded/lib/ruby/2.2.0/timeout.rb:32:in `block in catch'
     from /opt/sensu/embedded/lib/ruby/2.2.0/timeout.rb:32:in `catch'
     from /opt/sensu/embedded/lib/ruby/2.2.0/timeout.rb:32:in `catch'
     from /opt/sensu/embedded/lib/ruby/2.2.0/timeout.rb:103:in `timeout'
     from /opt/sensu/embedded/lib/ruby/2.2.0/timeout.rb:124:in `timeout'
     from /opt/sensu/embedded/lib/ruby/gems/2.2.0/gems/sensu-plugins-hipchat-0.0.3/bin/handler-hipchat.rb:68:in `handle'
     from /opt/sensu/embedded/lib/ruby/gems/2.2.0/gems/sensu-plugin-1.2.0/lib/sensu-handler.rb:55:in `block in <class:Handler>'"
  ]
}
@nhooey nhooey changed the title Detect HTTP 429 "rate limiting" response code React appropriately to HTTP 429 "rate limiting" response code Apr 1, 2016
@majormoses
Copy link
Member

majormoses commented Dec 8, 2017

Basically we need to look at the response code and if its a 429 then we need a exponential backoff and retry strategy.

@majormoses
Copy link
Member

I just realized that looking at the stack trace that is something that they should probably be handled by the upstream library. I need to do some research but this is actually a bug on their end from what I can tell so far.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants