Getting 429 - TooManyRequests on Get Subscriber

  • 24 October 2021
  • 3 replies

Badge +1

Getting a 429 on the request. The response body has this:
    {"code":7638,"message":"There is another request in flight trying to perform the same action."}

The requests are made from backend webhook code where two webhook events for the same user get load balanced to two completely different servers. So, I do have 2 outstanding requests for the same user. I'm wondering if there is a way around this since the amount of work to coordinate a single outstanding request per user isn't trivial.



Best answer by sundeep 27 October 2021, 22:13

View original

3 replies

Userlevel 3
Badge +8

Hi @Ken Jones! It looks like you may have sent this in as a ticket which I responded to, but just to be on the safe side I’ll also post my reply here:

Yeah so 429 typically indicates "Too Many Requests" but as you see the actual error is just there was two requests that happened too close together for the same user. In your case, this could maybe happen if two webhook events for the same user were sent in rapid succession (this is pretty rare). 

How often are you getting this error? If you're not getting it too often, I'd recommend just retrying after a short period of time. You shouldn't need to coordinate a single outstanding request per user, especially because webhook event volume is usually not that high.

Badge +1

That was from my co-worker so we did see the response. These are currently from testing sandbox purchases and the accelerated subscription lifecycle. So it may be rare for something like this to happen in production but want to make sure before we ship this product. RevCat does retry on failed webhook return codes so they do all eventually come through. See logging screenshot below (oldest at the bottom). I may just rely on this retry behavior for now and turn the log level down to warn. Thanks for getting back to us. -- Ken


Userlevel 2
Badge +4

My team is facing this and it’s extremely surprising to us! It’s not like we are DDOSing RC servers.  It’s just two calls being issued from two different servers of us to fetch the latests subscription info (what we are paying RC for). 

As posted by the original author, it adds an extra layer of complexity and unreliability for us to manage a single source + caching the response for a short period of time.

Is it possible that you guys relax the 429 errors to like 3 or 5 very-close calls?