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

Node stops answering Pings when put in background #282

Open
lrahmani opened this issue Apr 29, 2020 · 0 comments
Open

Node stops answering Pings when put in background #282

lrahmani opened this issue Apr 29, 2020 · 0 comments

Comments

@lrahmani
Copy link

Issue

When a node is sent to background (^z + bg) it stops answering pings from other nodes. The issue is also present when the node is a run as a background process using &. I didn't investigate further issues caused by running the node in the background other than not answering pings (for e.g. handling incoming message).

Expected behavior

I expect the node to have similar behavior when run/put in background as when it is running in foreground.

How to reproduce it

This behavior is entirely reproducible using the chat example running on a ubuntu:18.4-based docker image with GNU bash-4.4.20(1)-release.

  1. get the chat example go get -d -v github.com/perlin-network/noise/cmd/chat
  2. run a first instance of the chat example go run github.com/perlin-network/noise/cmd/chat -p 9000
  3. on a separate terminal, run a second instance of the chat example to join the first one go run github.com/perlin-network/noise/cmd/chat -p 9001 127.0.0.1:9000. Both nodes should learn about each other
  4. send the first instance (listening on port 9000) to the background by pressing Ctrl+Z and then executing command bg
  5. run a thrid instance of the chat example with first instance's address as bootstrap node go run github.com/perlin-network/noise/cmd/chat -p 9003 127.0.0.1:9000. This node will shortly report that it cannot ping the bootstrap node.

Suggestions

From jobs output, it seems that the node process doesn't switch to be Running when executing bg after being stopped by Ctrl+Z.
The issue could be related to the input goroutine not having access to stdin, unfortunately I am very new to go and cannot provide suggestions about goroutine interactions with the shell.

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

1 participant