#GiovanniV - Token In Use
1 messages ยท Page 1 of 1 (latest)
Hello! What does EPP stand for?
The token_in_use error is not referring to the idempotency key, it's referring to the token being used to create the Charge. Are you making these requests serially (meaning you wait for one request to complete and return a response before moving onto the next)?
If you're making the requests in parallel you should switch to making them serially and that may solve the issue.
that makes sense thank you
Happy to help! Let us know if that doesn't solve the issue and we can help further. ๐
thanks for the quick response. So, are you saying this is more of an internal Stripe token allocation issue vs. something in our code? We are sending in parallel currently for improved throughput, but your recommendation is to make this a serial operation?
Yes. You're encountering internal locks on our side because you're trying to perform operations on the same thing at the same time.
If you switch to a serial approach you should be able to avoid that issue.
in particular, the issue here is that you're trying to make many charges on the same connected account in parallel
presumably you'd be making those on many different accounts in production?
if you're trying to simulate making a lot of charges, you might need to create more than one test connected account to run the charges on
Regardless, though, we don't recommend doing something like this in parallel. I know you're not getting a 429, but this is very similar to a lock timeout as documented here: https://stripe.com/docs/rate-limits#object-lock-timeouts
Specifically this part:
Lock contention is caused by concurrent access on related objects. Integrations can vastly reduce this by making sure that mutations on the same object are queued up and run sequentially instead. Concurrent operations against the API are still okay, but try to make sure simultaneous operations operate only on unique objects.
thank you!
Happy to help! Nice to see you survived the Discord outage. ๐