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

Retry signing the request if too slow #363

Merged
merged 1 commit into from
Jul 2, 2024

Conversation

kofrezo
Copy link
Contributor

@kofrezo kofrezo commented Jun 27, 2024

There are cases where the cryptographic operation to sign the request takes unusually long. One example is when using a hardware such as the YubiKey which is busy signing other stuff.

The Serveradmin server is pretty strict and would reject these as expired for security reasons.

To gracefully handle temporary congestion in the signing we log an error and retry the operation up to Settings.tries.

There are cases where the cryptographic operation to sign the request
takes unusually long. One example is when using a hardware such as the
YubiKey which is busy signing other stuff.

The Serveradmin server is pretty strict and would reject these as expired
for security reasons.

To gracefully handle temporary congestion in the signing we log an error
and retry the operation up to Settings.tries.
f'Signing the requests took {time_spent_signing} seconds! '
'Serveradmin would reject this request. Maybe your signing '
f'soft-/hardware is congested ? Retry {retry}/{Settings.tries}.')
return _build_request(endpoint, get_params, post_params, retry+1)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Question to my reviewers: Should we consider a random sleep here ?

Copy link
Member

Choose a reason for hiding this comment

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

I think for now we can leave it without sleeps

f'Signing the requests took {time_spent_signing} seconds! '
'Serveradmin would reject this request. Maybe your signing '
f'soft-/hardware is congested ? Retry {retry}/{Settings.tries}.')
return _build_request(endpoint, get_params, post_params, retry+1)
Copy link
Member

Choose a reason for hiding this comment

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

I think for now we can leave it without sleeps

@kofrezo kofrezo merged commit f09d43a into main Jul 2, 2024
5 checks passed
@kofrezo kofrezo deleted the dk_optmistic_retry_on_congestion branch July 2, 2024 12:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants