pinterest-for-woocommerce
pinterest-for-woocommerce copied to clipboard
Create merchant endpoint shouldnt be called repeatedly if there is an error while creating merchants
Describe the bug:
Recently on pinterest we noticed that as the error rate increased in create merchant (due to rate limiting, which was fixed by increasing the rate limit), RPS also increased. See graph below
From initial research the root cause is mostly due to healthcheck or product sync
Steps to reproduce:
- Create a new shop and add it to a new pinterest account
- Make sure merchant creation fails on pinterest side
- If you have multiple such failed merchant creations, then you will notice that create merchant end point will get called repeatedly
Expected behavior:
When there is an error in API call, e.g in merchant creation it is better to exponentially back off rather than repeatedly try it
Actual behavior:
If there is an error in merchant creation, the create merchant is called repeatedly during health checks and product sync
Additional details:
Thanks @adarshakb 👍
Related: https://github.com/woocommerce/pinterest-for-woocommerce/issues/446#issuecomment-1139745708