Skip to content

accept tracker connections#187

Open
laur89 wants to merge 1 commit into
anthonyraymond:masterfrom
laur89:accept-tracker-connections
Open

accept tracker connections#187
laur89 wants to merge 1 commit into
anthonyraymond:masterfrom
laur89:accept-tracker-connections

Conversation

@laur89

@laur89 laur89 commented Feb 3, 2023

Copy link
Copy Markdown
Contributor

Note this change is on top of #172 -- merge that beforehand.
merged

@laur89 laur89 force-pushed the accept-tracker-connections branch 4 times, most recently from 852c04f to ad725e2 Compare February 3, 2023 06:31
@laur89 laur89 changed the title Accept tracker connections WIP: accept tracker connections Feb 3, 2023
@laur89 laur89 force-pushed the accept-tracker-connections branch 3 times, most recently from dc0797b to f9e6a92 Compare February 7, 2023 15:48
selector.select();
for (SelectionKey key : selector.selectedKeys()) {
if (key.isAcceptable()) {
this.listenChannel.accept();

@laur89 laur89 Feb 7, 2023

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note no I/O is done here at the moment, we only accept the connection. Any ideas how to proceed, if at all?

@anthonyraymond anthonyraymond Feb 15, 2023

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The macro vision is:

  • When a peer connect though bittorrent protocol => send a choke message

But "connect through bittorrent protocol" is easier said than done 😆 .

it's something related to : https://github.com/mpetazzoni/ttorrent/blob/2c8bb62f9f69b74c014358d446554df96ec91c7c/ttorrent-client/src/main/java/com/turn/ttorrent/client/network/HandshakeReceiver.java#L148

Instead of adding peers to whatever store you'll just choke them (maybe close connection?).

This feature require a deep comprehension of the peer section of BitTorrent RFC (and also to investigate the source code of libtorrent and other OpenSource clients to understand how they individualy do their job).

@laur89

laur89 commented Feb 16, 2023

Copy link
Copy Markdown
Contributor Author

Ye this is going to need quite a bit of research/know-how.
Would you be willing to merge this as-is, considering it's reportedly solved problem to one user. And possibly/hopefully it improves existing logic somewhat.

@WZrocks

WZrocks commented Mar 19, 2023

Copy link
Copy Markdown

Ye this is going to need quite a bit of research/know-how. Would you be willing to merge this as-is, considering it's reportedly solved problem to one user. And possibly/hopefully it improves existing logic somewhat.

Two users. :-) I have been waiting for this merge, and updated Docker image, since the opening of this PR.

@anthonyraymond

Copy link
Copy Markdown
Owner

Hello there, i've not forgotten about you.

But i'm lacking time to review that. I try to give it a look ASAP

@WZrocks

WZrocks commented May 8, 2023

Copy link
Copy Markdown

Do you have any idea if and when you'll have the time to look at this, @anthonyraymond? I don't want to rush you, I'm already very grateful for what you did with this project so far, I'm just looking for an ETA.

@anthonyraymond

anthonyraymond commented May 9, 2023

Copy link
Copy Markdown
Owner

Hello,
i'm still unsure if i want to merge this as-is or not. Not sure if that makes its more unsafe or not.

An analogy for this PR is:

  • before nobody won't ever answer the call when the phone rings.
  • Now someone will, but he is clearly not speaking the language that you expect the people to speak. You'll know it's not the person it is supposed to be on the other end.

@WZrocks

WZrocks commented May 10, 2023

Copy link
Copy Markdown

That is a valid point. Would it be possible to make it optional in config? @laur89 @anthonyraymond

@rursache

rursache commented May 26, 2023

Copy link
Copy Markdown

@anthonyraymond i think it's best to just add a toggle in settings. for me it works great but maybe others can have issues, indeed. can't wait to see this merged and published <3

@WZrocks

WZrocks commented Jun 26, 2023

Copy link
Copy Markdown

I don't think the config option will come anytime soon either, right? 😔

@rursache

rursache commented Nov 1, 2023

Copy link
Copy Markdown

@anthonyraymond can we please merge this as well? been using it since then and it's all good. maybe add a config toggle in the settings just in case?

@anthonyraymond

anthonyraymond commented Nov 2, 2023

Copy link
Copy Markdown
Owner

@rursache i don't think this is ever going to be added as is. It's sounds a bit dangerous for most people.

I'll include a real and complete implementation in the next version (built from scratch), but for now i prefer not to include it as is

@rursache

rursache commented Nov 2, 2023

Copy link
Copy Markdown

@anthonyraymond
I'll include a real and complete implementation in the next version (built from scratch), but for now i prefer not to include it as is

thank you, looking forward to your implementation!

@rursache

rursache commented Dec 20, 2025

Copy link
Copy Markdown

@anthonyraymond
any update on merging this one? as a flag, setting, hidden, whatever

i've been using it for 2 years already, works fine. most trackers refuse joal with the normal release

@laur89 laur89 changed the title WIP: accept tracker connections accept tracker connections Dec 22, 2025
@Neurology0443

Copy link
Copy Markdown

Hello :)

After a period of testing I noticed a higher RAM usage that keeps increasing over time when merging this PR (see here #268 ).

Can someone confirm this behavior on their side ?

@rursache

Copy link
Copy Markdown

@Neurology0443 saw it as well but had a similar issue before the PR as well. for years i simply had a hourly cronjob to restart the contaier and that's fine so far. or it's probably easier to limit ram usage via docker compose and let it handle this

@Neurology0443

Neurology0443 commented Jan 31, 2026

Copy link
Copy Markdown

Thanks for your answer 👍

I tried with the following docker-compose env. variable:

    environment:
      - "JAVA_TOOL_OPTIONS=-Xms256m -Xmx512m"

From the docker logs it seems to pick-up the variable, however it's ignored:

CPU %     MEM USAGE / LIMIT     MEM %     NET I/O           BLOCK I/O         PIDS
0.31%     780.3MiB / 7.649GiB   9.96%     248MB / 238MB     3.28MB / 19.8MB   59

Yeah, a hourly cronjob is more of a workarround than a real solution, but I guess that's how it is... Invidious has a similar issue anyway :/

Thanks !

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 this pull request may close these issues.

5 participants