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

Process unresponsive to SIGINT #2785

Open
btwiuse opened this issue May 6, 2024 · 1 comment
Open

Process unresponsive to SIGINT #2785

btwiuse opened this issue May 6, 2024 · 1 comment
Assignees

Comments

@btwiuse
Copy link

btwiuse commented May 6, 2024

This bug was discovered on the master branch after the merge at 9d149fa3cbba11f2985fbc8e42cd2cf6b9a679f7

Using ./examples/echo to reproduce, first set libp2p to the problematic version, the process can't be killed with ctrl-c

[root@railway echo]# go get github.com/libp2p/go-libp2p@9d149fa3cbba11f2985fbc8e42cd2cf6b9a679f7 
go: upgraded github.com/libp2p/go-libp2p v0.33.1-0.20240321170946-39242a499ce6 => v0.33.1-0.20240321171834-9d149fa3cbba
[root@railway echo]# go run . -l 1234
2024/05/06 21:56:06 I am /ip4/127.0.0.1/tcp/1234/p2p/QmRvs2Uj3rkx9RUbawDPSTDkM6og4C4A4RtB15xdXjwSB9
2024/05/06 21:56:06 listening for connections
2024/05/06 21:56:06 Now run "./echo -l 1235 -d /ip4/127.0.0.1/tcp/1234/p2p/QmRvs2Uj3rkx9RUbawDPSTDkM6og4C4A4RtB15xdXjwSB9" on a different terminal
^C^C^C

Now downgrade libp2p to its parent commit, the process gets interrupted as expected

[root@railway echo]# go get github.com/libp2p/go-libp2p@39242a499ce6fcd64dd414b504f538ab329b87fc
go: downgraded github.com/libp2p/go-libp2p v0.33.1-0.20240321171834-9d149fa3cbba => v0.33.1-0.20240321170946-39242a499ce6
[root@railway echo]# go run . -l 1234
2024/05/06 22:02:58 I am /ip4/127.0.0.1/tcp/1234/p2p/QmZELJtUuWc255ytkFrPHSqEfpGJyJxZVswLRa2aEPVcoW
2024/05/06 22:02:58 listening for connections
2024/05/06 22:02:58 Now run "./echo -l 1235 -d /ip4/127.0.0.1/tcp/1234/p2p/QmZELJtUuWc255ytkFrPHSqEfpGJyJxZVswLRa2aEPVcoW" on a different terminal
^Csignal: interrupt
@MarcoPolo MarcoPolo self-assigned this May 6, 2024
@MarcoPolo
Copy link
Contributor

This issue is that uber fx (a dependency we have to construct the host) will register their own signal handler even if we stop the host.

We should be able to fix this once this issue is resolved: uber-go/fx#1197

As a workaround your program can listen for sigint.

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