filecoin-project / lotus

Reference implementation of the Filecoin protocol, written in Go
https://lotus.filecoin.io/
Other
2.82k stars 1.25k forks source link

wrong logs - node daemon dedicated string var reused for worker #9135

Closed f8-ptrk closed 2 weeks ago

f8-ptrk commented 2 years ago

Checklist

Lotus component

Improvement Suggestion

https://github.com/filecoin-project/lotus/blob/b706efc33bd392d5be4f0be6679f8c5b23d98e26/node/repo/interface.go#L31

seems to be reused for the lotus worker (maybe the miner too)

resulting in a "wrong" error message

rjan90 commented 2 years ago

Hey @f8-ptrk! When do you see this error pop up? When trying to run a second lotus-worker on the same port? Would be helpful for understanding where this code is getting reused.

f8-ptrk commented 2 years ago

when running 2 lotus-workers with the same settings, yes

the error message is for the daemon and most likely the ErrRepoAlreadyLocked gets used everywhere

rjan90 commented 2 years ago

So it´s these lines: https://github.com/filecoin-project/lotus/blob/0c91b0dc1012c3e54b305a76bb25fb68390adf9d/cmd/lotus-worker/main.go#L114-L117

f8-ptrk commented 2 years ago

https://github.com/filecoin-project/lotus/blob/0c91b0dc1012c3e54b305a76bb25fb68390adf9d/cmd/lotus-worker/main.go#L273 downwards

the run sub command has its own action - the app.run just starts the command line parsing logic of ufave/cli

f8-ptrk commented 2 years ago

https://github.com/filecoin-project/lotus/blob/0c91b0dc1012c3e54b305a76bb25fb68390adf9d/cmd/lotus-worker/main.go#L415

https://github.com/filecoin-project/lotus/blob/0c91b0dc1012c3e54b305a76bb25fb68390adf9d/node/repo/fsrepo.go#L225 https://github.com/filecoin-project/lotus/blob/0c91b0dc1012c3e54b305a76bb25fb68390adf9d/cmd/lotus-worker/main.go#L429 https://github.com/filecoin-project/lotus/blob/0c91b0dc1012c3e54b305a76bb25fb68390adf9d/node/repo/fsrepo.go#L364

thats the call path and the this line returns the error string with the wrong message

https://github.com/filecoin-project/lotus/blob/0c91b0dc1012c3e54b305a76bb25fb68390adf9d/node/repo/fsrepo.go#L370

f8-ptrk commented 2 years ago

need more details?

rjan90 commented 2 years ago

No, think that is more then enough 😄!

Reiers commented 2 years ago

Can confirm that the line("repo is already locked (lotus daemon already running)") are promted if the miner is forcefully shut down as well as lotus markets.

f8-ptrk commented 2 years ago

touch repo.lock would have done it - no need to kill stuff @Reiers