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

Improvement: Add HTTP retries when the remote side does not respond #103

Closed
freefd opened this issue Jun 23, 2024 · 3 comments
Closed

Improvement: Add HTTP retries when the remote side does not respond #103

freefd opened this issue Jun 23, 2024 · 3 comments
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@freefd
Copy link
Contributor

freefd commented Jun 23, 2024

I've just faced the rare but painful side effect when the HTTP transport can do retransmission on the L3 but has no retransmissions for L4:

2024/06/23 17:40:35 +0000 INF ../tmp/src/notifier/telegram.go:69 > Alert sent event_id=1719153634.438606-w2iy47 provider=Telegram
2024/06/23 17:40:37 +0000 WRN ../tmp/src/notifier/nfty.go:64 > Unable to send alert error="Post \"https://ntfy.domain.tld/topicname\": dial tcp 192.168.xxx.xxx:443: connect: no route to host" event_id=1719153634.438606-w2iy47 provider=Ntfy

That happened due to reverse proxy pod in front of Ntfy was restarting and therefore unavailable.

Is it possible to add to both functions from https://github.com/0x2142/frigate-notify/blob/main/util/httpclient.go some reasonable retries, let's say 5 or even 6. So the maximum delay could be about 1 minute (6 retries * 10 seconds timeout).

Whether this needs to be configurable or not - idk.

Thank you.

@0x2142
Copy link
Owner

0x2142 commented Jun 24, 2024

Interesting - Thanks for reporting this. Should be easy enough to fix, I'll add it to the list!

@0x2142 0x2142 self-assigned this Jun 24, 2024
@0x2142 0x2142 added the enhancement New feature or request label Jun 24, 2024
@0x2142 0x2142 added this to the v0.3.3 milestone Jun 24, 2024
@freefd
Copy link
Contributor Author

freefd commented Aug 13, 2024

Work like a charm, thanks a lot.

@0x2142
Copy link
Owner

0x2142 commented Aug 14, 2024

Awesome. Glad to hear it and thanks for the feedback!

@0x2142 0x2142 closed this as completed Aug 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants