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

Adjust suma timeouts #2535

Merged
merged 1 commit into from
Apr 22, 2024
Merged

Adjust suma timeouts #2535

merged 1 commit into from
Apr 22, 2024

Conversation

nelsonkopliku
Copy link
Member

@nelsonkopliku nelsonkopliku commented Apr 19, 2024

Description

Adjusting timeouts for suma requests.

By default all requests to suma have been set to [timeout: 500, recv_timeout: 1_500]

https://hexdocs.pm/httpoison/HTTPoison.Request.html

:timeout - timeout for establishing a TCP or SSL connection, in milliseconds. Default is 8000
:recv_timeout - timeout for receiving an HTTP response from the socket. Default is 5000

Also the SUMA genserver call timeout has been increased to 15s which covers the worst case scenarios where:

  • all 5 retrials of login fail responding in time ~10s or less
  • login succeeds only on the last try plus discovery request: 4 login failures + 1 login success + 1 specific api for a total amount of ~12s or less

This would benefit also applied in this case #2531.
And besides that, as discussed with @arbulu89, we could also consider breaking the loop of login retrial if we detect a 401 during a login attempt.

How was this tested?

Manual testing.

@nelsonkopliku nelsonkopliku self-assigned this Apr 19, 2024
@nelsonkopliku nelsonkopliku added the enhancement New feature or request label Apr 19, 2024
@nelsonkopliku nelsonkopliku marked this pull request as ready for review April 19, 2024 09:27
Copy link
Contributor

@arbulu89 arbulu89 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess that this reduces the authentication failure time.
Anyway, we still have a raise error only with this change.
I guess #2531 (or whatever other solution) would fix this

@nelsonkopliku
Copy link
Member Author

Not only auth, but every call. And it makes timeouts kinda predictable.
And yes, we still need to adjust where the synchronization point happens.

@nelsonkopliku nelsonkopliku merged commit b52fd59 into main Apr 22, 2024
51 checks passed
@nelsonkopliku nelsonkopliku deleted the improve-suma-timeouts branch April 22, 2024 07:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Development

Successfully merging this pull request may close these issues.

None yet

2 participants