libtorrent icon indicating copy to clipboard operation
libtorrent copied to clipboard

No connections established after reconnecting to the network

Open blahdy opened this issue 4 years ago • 11 comments

after reconnecting to wifi or deactivating-activating Ethernet - dht drops to 0 peers, trackers are unreachable. mostly reproduced on portables that go to sleep often, hence reconnect to wireless upon waking. traced it to these lines, pure trial and error. no idea what the code does and it might be a qbittorrent issue, but they don't care about the mac platform much, so I'll try my luck here.

libtorrent version (or branch): https://github.com/arvidn/libtorrent/commit/88d9c05e3c9fa7388d50554b48f5470a395bd94f#diff-aaf7190ba8a81c1a1fed8eeb605b4c6941a522dd0fd14ac07bdb5f97c2c676a5R248 onwards platform/architecture: qbittorrent on macos 10.14+

blahdy avatar Jan 04 '21 23:01 blahdy

This issue is there since libtorrent 1.2.4. https://github.com/arvidn/libtorrent/issues/4412

ghost avatar Jan 08 '21 12:01 ghost

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Apr 10 '21 05:04 stale[bot]

I believe this is a pretty legit issue. Can we please have some feedback?

blahdy avatar Apr 24 '21 09:04 blahdy

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Jul 23 '21 13:07 stale[bot]

There used to be an issue in boost.asio breaking things after going to sleep and waking up again.

after reconnecting to wifi or deactivating-activating Ethernet - dht drops to 0 peers, trackers are unreachable.

So, going to sleep and waking up, or bringing a NIC down and back up again causes libtorrent to fail every peer- and tracker connection it attempts. Is that right?

mostly reproduced on portables that go to sleep often, hence reconnect to wireless upon waking.

So, it doesn't reproduce reliably. Is that what you mean?

I don't understand what you mean by "hence reconnect to wireless upon waking". That seems to suggest that connections are being made (over WiFi), which would contradict the first sentence.

traced it to these lines, pure trial and error. no idea what the code does and it might be a qbittorrent issue, but they don't care about the mac platform much, so I'll try my luck here.

So, this only happens on Mac OS?

Do you have any logs?

arvidn avatar Jul 23 '21 20:07 arvidn

as far as I can tell, what's happening is that when MacOS notifies applications that its network has changed, it's not done setting up the routes yet. So when libtorrent looks at the networks, none of them can route to the internet (because there is no route yet), and concludes that no interface need to run a DHT node.

arvidn avatar Jul 25 '21 20:07 arvidn

could someone give this a try? https://github.com/arvidn/libtorrent/pull/6338

arvidn avatar Jul 25 '21 20:07 arvidn

sorry for the late reply. it's fixed. thanks!

blahdy avatar Aug 16 '21 11:08 blahdy

So this patch fixes the problem only on MacOS. What about linux and windows?

ghost avatar Aug 18 '21 13:08 ghost

@an0n666 I think the problem on linux and windows is a different problem. Is there a ticket describing steps to reproduce?

arvidn avatar Aug 19 '21 04:08 arvidn

@an0n666 I think the problem on linux and windows is a different problem. Is there a ticket describing steps to reproduce?

Steps to reproduce error on Windows: Method 1 :

  • Use a VPN. Listen on that specific VPN interface GUID.
  • Disconnect the VPN.
  • DHT nodes drop to 0.
  • Reconnect VPN.
  • DHT nodes stay at 0.

Method 2 :

  • Restart the router.
  • DHT nodes drop to 0.
  • Wait for router to finish restarting and network coming back.
  • DHT nodes stay at 0.

ghost avatar Aug 19 '21 09:08 ghost