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

New hangs when started with option ModeServer #697

Closed
paul-freeman opened this issue Dec 2, 2020 · 2 comments · Fixed by #698
Closed

New hangs when started with option ModeServer #697

paul-freeman opened this issue Dec 2, 2020 · 2 comments · Fixed by #698

Comments

@paul-freeman
Copy link

I recently updated a project to v0.11.0 and found that the dht.New() command would frequently hang during my testing. Even waiting 10 seconds was not enough time for the function to return. Removing the option for ModeServer would prevent the hang, but would not establish DHT connections correctly.

Reverting to my prior version, v0.8.3, worked as expected.

I did some digging, and believe the hang is from: New() | newSubscriberNotifee() | peerFound() | dht.addPeerToRTChan <- addPeerRTReq{p, queryPeer}

case dht.addPeerToRTChan <- addPeerRTReq{p, queryPeer}:

I should qualify that I am testing with 4 applications running two DHTs. The first is a pretty standard one that is set to AutoMode and seems to start up fine. The second one runs in ServerMode and is the one that hangs. The apps run in separate Docker containers and I am networking them together using docker compose and my LAN. I read that there are some issues with running the DHT in server mode on a LAN, so I admit I could be running into a problem related to this. However, I have been using the DHT in my code for almost a year and these tests worked as expected until the update to v0.11.0. Perhaps I missed a documented change somewhere.

In any event, I would expect the New() function to specify that it could hang under certain conditions, which is what led to my decision to file an issue.

I will try to develop some sort of minimal example, if possible, and post it here. Until then, any tips would be appreciated.

@aschmahmann
Copy link
Contributor

@paul-freeman I haven't had a chance to look into why this differs from ModeServer to non-server. Although if you're changing a whole test setup it may be that it's not that New() is hanging because it is in ModeServer but instead because the other peers in the test are in ModeServer.

Do you mind giving #698 a spin and seeing if that fixes things for you?

@paul-freeman
Copy link
Author

@aschmahmann I can confirm that #698 fixes the issue I was seeing. When I installed that branch the problem went away and when I rolled back to v0.11.0 the problem returned. Thanks for looking into this so promptly!

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

Successfully merging a pull request may close this issue.

2 participants