You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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}
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.
The text was updated successfully, but these errors were encountered:
@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?
@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!
I recently updated a project to
v0.11.0
and found that thedht.New()
command would frequently hang during my testing. Even waiting 10 seconds was not enough time for the function to return. Removing the option forModeServer
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}
go-libp2p-kad-dht/dht.go
Line 683 in 7db4172
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 inServerMode
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 tov0.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.
The text was updated successfully, but these errors were encountered: