arvidn / libtorrent

an efficient feature complete C++ bittorrent implementation
http://libtorrent.org
Other
5.27k stars 997 forks source link

I2P SAM connection is not reestablished when closed #7453

Open Vort opened 1 year ago

Vort commented 1 year ago

Tested with client_test and i2pd.

  1. Start i2pd.
  2. Start client_test and verify that SAM session is active at http://127.0.0.1:7070/?page=sam_sessions.
  3. Stop i2pd (Force shutdown).
  4. Start i2pd again.

Expected behaviour: SAM session is recreated once i2pd is up again (after step 4). Actual behaviour: no session is (re)created, SAM sessions page is empty.

Reason: i2pd crashes sometimes and it is more convenient for user to restart just i2pd and not both i2pd and torrent client.

libtorrent version (or branch): c2012b084c6654d681720ea0693d87a48bc95b14 platform/architecture: Windows compiler and compiler version: clang 15.0.7

stale[bot] commented 1 year ago

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.

mpeter50 commented 1 year ago

I have a similar issue that I think could be caused by the same problem.

The short version is that when a libtorrent client's machine has been suspended (sleep/hibernate) for long enough, libtorrent loses the SAM connection until it is manually turned off and on again on the client side. I have also found a clue that may mean that libtorrent tries to reconnect, but does that incorrectly. It may be good to know that I have this problem with the Java implementation of the I2P router, not I2PD, so this may not be a router issue.

Details can be found at the above linked issue in the qBittorrent repo. If it is preferred to also post the info to this issue or a separate one in the repo, please let me know.

mpeter50 commented 11 months ago

I have disabled I2P functionality in qBittorrent a few weeks ago, and as it looks the frequent SAMBridge logs have stopped right there. Last such message was printed on 2023-11-09, almost a month ago. I don't remember exactly when did I turned off I2P functionality, but that date seems about right.

For now I won't turn it back on, as it wouldn't work anyway on my system.

arvidn commented 9 months ago

I believe this is a missing feature. The SAM connection is triggered by setting a SAM hostname and port in the settings.