-
Notifications
You must be signed in to change notification settings - Fork 230
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
Silencing Connection Refused
logs
#404
Comments
This issue belongs in the |
So in this file: https://github.com/contribsys/faktory_worker_go/blob/main/runner.go I'm going to replace L83-102 with: //Implement exponential backoff for creating a process
sleep := 1
for i := 0; i < 10000; i++ {
if mgr.state != "" {
return
}
// check for shutdown
select {
case <-mgr.done:
return
default:
}
err := processOne(mgr)
if err != nil {
mgr.Logger.Debug(err)
if _, ok := err.(*NoHandlerError); !ok {
time.Sleep(1 * time.Second)
}
}
time.Sleep(time.Duration(sleep) * time.Second)
sleep *= 2
} There's a repo: github.com/cenkalti/backoff that can also do it, but I'm not sure what the rules are for incorporating new dependencies into your repo, so here's the boilerplate version. I can't make a PR since I'm not a contributor. So can you add me as a contributor or is there another way you want me to create the PR? |
Creating a PR is pretty simple with GitHub. You Fork the repo, create a new
branch, make your changes, test them, commit them, push them to your fork
and then come back to github UI where it will allow you to create a PR
based on your fork’s branch.
…On Fri, May 6, 2022 at 15:02 Thomas Morris ***@***.***> wrote:
So in this file:
https://github.com/contribsys/faktory_worker_go/blob/main/runner.go
I'm going to replace L83-102 with:
//Implement exponential backoff for creating a process
sleep := 1
for i := 0; i < 10000; i++ {
if mgr.state != "" {
return
}
// check for shutdown
select {
case <-mgr.done:
return
default:
}
err := processOne(mgr)
if err != nil {
mgr.Logger.Debug(err)
if _, ok := err.(*NoHandlerError); !ok {
time.Sleep(1 * time.Second)
}
}
time.Sleep(time.Duration(sleep) * time.Second)
sleep *= 2
}
There's a repo: github.com/cenkalti/backoff that can also do it, but I'm
not sure what the rules are for incorporating new dependencies into your
repo, so here's the boilerplate version.
I can't make a PR since I'm not a contributor. So can you add me as a
contributor or is there another way you want me to create the PR?
—
Reply to this email directly, view it on GitHub
<#404 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAAAWX24JFTBPODFY2EWIELVIWJILANCNFSM5VJI2NMQ>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
Are you using an old version?
Have you checked the changelogs to see if your issue has been fixed in a later version?
https://github.com/contribsys/faktory/blob/master/Changes.md
https://github.com/contribsys/faktory/blob/master/Pro-Changes.md
https://github.com/contribsys/faktory/blob/master/Ent-Changes.md
So whenever our
faktory
worker is down, the connection will constantly return this error. Is there a way to silence this particular log after the first failure? Or is there a way to have exponential retry logic to try to reconnect?The text was updated successfully, but these errors were encountered: