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

Incorrect status code in case of "Too many requests" response #1203

Open
eGavr opened this issue Mar 23, 2022 · 8 comments
Open

Incorrect status code in case of "Too many requests" response #1203

eGavr opened this issue Mar 23, 2022 · 8 comments

Comments

@eGavr
Copy link

eGavr commented Mar 23, 2022

Selenoid version: 1.10.7
Broken since selenoid version: 1.10.7
Run selenoid with options -disable-queue -limit 5

Current behaviour:

If queue is full selenoid returns an unknown error with status code 500

Expected behaviour:

If queue is full selenoid returns an error with status code 429 (too many requests)

JFYI. In out team we've hacked the problem this way.

@vania-pooh
Copy link
Member

@eGavr no such status code in W3C standard. https://www.w3.org/TR/webdriver/#errors

@eGavr
Copy link
Author

eGavr commented Mar 24, 2022

@eGavr no such status code in W3C standard. https://www.w3.org/TR/webdriver/#errors

Yes, you are right.

But how can we determine that the error reason is "Too many requests"? This value is in error message, but I think relying for this value in error message is not a good idea.

@vania-pooh
Copy link
Member

@eGavr should rely on error field which is constant.

@eGavr
Copy link
Author

eGavr commented Mar 28, 2022

The full error is

{"name":"HTTPError","hostname":"127.0.0.1","method":"POST","path":"/wd/hub/session","protocol":"http:","url":"http://127.0.0.1:4444/wd/hub/session","gotOptions":{"path":"/wd/hub/session","protocol":"http:","hostname":"127.0.0.1","hash":"","search":"","pathname":"/wd/hub/session","href":"http://127.0.0.1:4444/wd/hub/session","port":4444,"retry":{"methods":{},"statusCodes":{},"errorCodes":{},"maxRetryAfter":60001},"headers":{"user-agent":"@yandex-int/[email protected]","accept":"application/json","accept-encoding":"gzip, deflate","content-type":"application/json","x-request-id":"27a71ca75354ec64b0f3706bce94200c","content-length":107},"hooks":{"beforeError":[],"init":[],"beforeRequest":[],"beforeRedirect":[],"beforeRetry":[],"afterResponse":[]},"decompress":true,"throwHttpErrors":true,"followRedirect":true,"stream":false,"form":false,"json":true,"cache":false,"useElectronNet":false,"nonRetriableStatusCodes":[],"retryCount":4,"applyMaxRetryTotalTimeBeforeRetry":true,"truncateResponseBodyLogAfter":500,"gotTimeout":{"request":60001},"method":"POST","baseUrl":"http://127.0.0.1:4444/","body":"{\"desiredCapabilities\":{\"screenResolution\":\"1600x1200x24\",\"browserName\":\"firefox\",\"browserVersion\":\"95.0\"}}"},"statusCode":500,"statusMessage":"Internal Server Error","headers":{"content-type":"application/json; charset=utf-8","date":"Mon, 28 Mar 2022 13:55:57 GMT","content-length":"62","connection":"close","x-request-id":"27a71ca75354ec64b0f3706bce94200c"},"body":{"value":{"error":"unknown error","message":"Queue Is Full"}}}

"unknown error" is not concrete error which cannot be associated with the original reason about "Queue Is Full" (I mean that in my program code I need to distinguish unknown errors and error because of full queue)

@vania-pooh
Copy link
Member

@eGavr probably we can introduce a new error code that is not included to the standard.

@eGavr
Copy link
Author

eGavr commented Mar 29, 2022

Until version 1.10.7 selenoid has an error that is not included to the standard, and this error was with status code 429 :)

@aandryashin
Copy link
Member

aandryashin commented Mar 29, 2022 via email

@eGavr
Copy link
Author

eGavr commented Jul 15, 2022

@eGavr probably we can introduce a new error code that is not included to the standard.

@vania-pooh @aandryashin

Can we do this?

To tell the truth, it seems that since status code 429 disappeared backward compatibility has been broken in 1.x

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