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

failed to start relay finder: relayFinder already running #2234

Closed
Shawn-Huang-Tron opened this issue Mar 31, 2023 · 6 comments
Closed

failed to start relay finder: relayFinder already running #2234

Shawn-Huang-Tron opened this issue Mar 31, 2023 · 6 comments

Comments

@Shawn-Huang-Tron
Copy link

Shawn-Huang-Tron commented Mar 31, 2023

I start a node in my local mac, and sometimes this error will show up:
2023-01-04T11:42:33.113+0800 ERROR autorelay autorelay/autorelay.go:80 failed to start relay finder {"error": "relayFinder already running"}

It sounds like that most time it appeared after my mac running a whole night , or I close my mac.

image

I have seen your code, is it because that when network changed, libp2p try to start relayFinder again?
Should this error be ignored?

go-libp2p v0.24.2

@MarcoPolo
Copy link
Collaborator

we probably check if is already running and not try to start it again. Want to take a stab at fixing it?

@Shawn-Huang-Tron
Copy link
Author

Hope to fix it . Thank you. Cause this error won't have any effect to functionity but people will get confused.

@marten-seemann
Copy link
Contributor

I think @sukunrt already has a fix for this.

@sukunrt
Copy link
Member

sukunrt commented Mar 31, 2023

this will be fixed by #2185 and #2225

however those are PRs for separate issues so a separate PR for this should be fine.
the approach I used is here:

err := r.relayFinder.Start()
if errors.Is(err, errAlreadyRunning) {
log.Debug("tried to start already running relay finder")
} else if err != nil {
log.Errorw("failed to start relay finder", "error", err)
} else {
r.metricsTracer.RelayFinderStatus(true)
}
case network.ReachabilityPublic:

@marten-seemann
Copy link
Contributor

@sukunrt Is this fixed now?

@sukunrt
Copy link
Member

sukunrt commented Apr 6, 2023

yeah this should be fixed now

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants