Subject: Re: Timeouts on slow connections

From: John Goerzen <[email-masked]>
Date: Mon, 02 Oct 2023 19:13:15 -0500

On Thu, Sep 28 2023, Sergey Matveev wrote:

> [[PGP Signed Part:Undecided]]
> *** John Goerzen [2023-09-28 10:04]:
>>Yep, I saw several MB tick over almost immediately in the -progress
>>display.
>
> I am not completely sure, but I think that is solely OS-dependant stuff.
> Personally I do not see so noticeable traffic bursts. However I think
> that somewhere (on some GNU/Linux distro I believe) I saw that behaviour.
>
> Unfortunately currently do not have enough time look deeper in that
> issue, still did not replying one of your email about ACKs :-(

OK, I've done some more testing and have some observations:

- When nncp-daemon is run in -ucspi mode, the problem does not occur.

- I have verified that onlinedeadline and maxonlinetime have been set
  quite high and should not be the cause of the problem.

- The problem occurs even on TCP connections from localhost.

- The problem occurs even when the client connects with nodelay.

I am pretty convinced that the problem isn't at the OS (socket) layer.
This is not standard behavior for a socket-type program written in C, so
it has to be somewhere in the golang stack.  But where?  The golang tcp
stuff does have integrated support for timeouts (unlike its C-based
counterparts), but I can't find any info on the defaults, and I went to
search the source tree... and..

There is NNCPDEADLINE!  I am going to test this out later.  I think it
is what I need.  I was puzzled at the beginning, thinking I could have
sworn we had talked about this before and that there was an environment
variable about this somewhere.  But I couldn't find it on any of the
commands pages (where TMPDIR and NNCPNOSYNC are documented).

If indeed this solves things as I think it may, it might be nice to
have it documented on the command page (or allow this to be set
somewhere in nncp.hjson).

Thanks!

- John