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

GetItemOffersBatch seems to be broken with the 1.7.34 update #812

Open
lboyarsky opened this issue Dec 30, 2024 · 5 comments
Open

GetItemOffersBatch seems to be broken with the 1.7.34 update #812

lboyarsky opened this issue Dec 30, 2024 · 5 comments

Comments

@lboyarsky
Copy link

lboyarsky commented Dec 30, 2024

Hi,

My code is calling GetItemOffersBatchAsync in a loop. It used to work fine, but since the 1.7.34 update, it hangs after the first successful call. When I enable debug mode, I can see what appears to be an infinite loop:

[...]
Attempting to increment tokens
0 tokens to replenish since 12/30/2024 12:38:13 AM
Attempting to increment tokens
0 tokens to replenish since 12/30/2024 12:38:13 AM
Attempting to increment tokens
0 tokens to replenish since 12/30/2024 12:38:13 AM
Attempting to increment tokens
0 tokens to replenish since 12/30/2024 12:38:13 AM
Attempting to increment tokens
0 tokens to replenish since 12/30/2024 12:38:13 AM
Attempting to increment tokens
0 tokens to replenish since 12/30/2024 12:38:13 AM
[...]

It seems the rate limiting was refactored in the latest version, which might be causing this issue.

Rolling back to the previous version resolves the problem.

@lboyarsky lboyarsky changed the title GetItemOffersBatch seems to be broken with the 1.7.33 update GetItemOffersBatch seems to be broken with the 1.7.34 update Dec 30, 2024
@FinnReilly
Copy link

Hi - I've done a quick investigation into this, and it looks as though the ProductPricing_GetItemOffersBatch rate limit type is hardcoded with the following parameters - new RateLimits(0.1M, 1, RateLimitType.ProductPricing_GetItemOffersBatch).

Unless I interpreted the RateLimits type incorrectly in my code, this means that tokens are added to the bucket at a rate of 0.1 per second with a maximum quantity (burst rate) of 1. This would appear to translate into one request being permitted every 10 seconds. @lboyarsky please could you confirm whether requests are being permitted at this rate?

If so then potential fixes would be changing this configuration or (better) allowing users to override it with their own RateLimit parameters when they call the GetItemOffersBatch method. @abuzuhri would you be ok with either/both of these changes? Fortunately this is the only one of the hardcoded RateLimit configurations which is even close to being this restrictive.

@abuzuhri
Copy link
Owner

abuzuhri commented Jan 8, 2025 via email

@FinnReilly
Copy link

FinnReilly commented Jan 8, 2025

@abuzuhri can we make the configured rate limiting less restrictive than one request every 10 seconds? This seems very restrictive.

Agree re. override, would be a nice additional feature but shouldn't require the user to do it and not the biggest priority right now

I could also improve the logging to more effectively manage user expectations - eg. "next token expected in {n} milliseconds"

@abuzuhri
Copy link
Owner

abuzuhri commented Jan 8, 2025 via email

@FinnReilly
Copy link

See #816 for fix + additional tests

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

No branches or pull requests

3 participants