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

Sometimes, cannot quit gracefully #229

Open
thinkAfCod opened this issue Nov 25, 2024 · 3 comments
Open

Sometimes, cannot quit gracefully #229

thinkAfCod opened this issue Nov 25, 2024 · 3 comments

Comments

@thinkAfCod
Copy link

Expected behaviour

When to kill, shisui could be quit with 100% certainty.

Actual behaviour

Sometimes, shisui cannot quit gracefully. And it may be blocked after printing the log:

if len(clientChan) == 0 {
	log.Warn("Waiting for the client to start...")
}
c := <-clientChan
c.closePortalRpcServer()
@r4f4ss
Copy link

r4f4ss commented Nov 29, 2024

@thinkAfCod I tried with different combination of parameters and I was not able to reproduce. Can you share the command/parameters you are using?

@thinkAfCod
Copy link
Author

Here is my go version:

go version go1.22.6 linux/amd64

Here is the command for startup:

go run -tags shisui ./cmd/shisui/main.go \
--nat stun \
--loglevel 5 \
--udp.port 10001 \
--rpc.addr 0.0.0.0 --rpc.port 11001 \
--pprof --pprof.addr=65.109.69.98 --pprof.port=12001 \
--data.dir shisui_node1 \
--networks state,history

@thinkAfCod
Copy link
Author

I modified the code to try to fix the bug:

go func() {
	for {
		select {
		case c, ok := <-clientChan:
			if !ok {
				break
			}
			c.closePortalRpcServer()
		default:
			log.Warn("Waiting for the client to start...")
			time.Sleep(time.Second)
		}
	}
}()

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

2 participants