-
Notifications
You must be signed in to change notification settings - Fork 11
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
Add retries on webhook failure #92
Add retries on webhook failure #92
Conversation
@m4rii0 Thank for contributing. What do you think about that we use here some popular library for doing retryable calls for example https://github.com/hashicorp/go-retryablehttp ? This library is widely used for the problem that we try solve here |
Absolutelly, thanks for the suggestion! Don't hesitate to suggest any other changes |
Overall test coverage after this changes will be lower, I see that after switching to aks-node-termination-handler/pkg/webhook/webhook.go Lines 88 to 90 in 53c5037
is not unused. Seems that this http client throws errors before. Investigating. |
Signed-off-by: Maksim Paskal <[email protected]>
Signed-off-by: Maksim Paskal <[email protected]>
@m4rii0 Add some test to your fork for retry logic on HTTP 500 and also check that on HTTP 400 will not be retry. Also notice that
|
Signed-off-by: Maksim Paskal <[email protected]>
@maksim-paskal, thanks for the tests! In our case, the issue was specifically Just a quick off-topic note: I noticed that the tool currently sends an error code even when a Here’s the related code snippet for reference: aks-node-termination-handler/pkg/webhook/webhook.go Lines 88 to 90 in 53c5037
Thanks again for your fast response and cooperation. |
Hi @maksim-paskal! 👋
We noticed an edge case where webhooks might fail to deliver correctly due to temporary connectivity issues with the node.
This PR adds support for retries when sending webhooks in case of errors, such as 5xx responses or connectivity problems.
Go isn't my primary language, so I’d appreciate any suggestions or improvements you might have!
Cheers,
Mario