public inbox for nncp-devel@lists.cypherpunks.ru
Atom feed
From: Sergey Matveev <stargrave@stargrave•org>
To: nncp-devel@lists.cypherpunks.ru
Subject: Re: Suggestions to make ACK easier
Date: Wed, 9 Aug 2023 15:04:07 +0300	[thread overview]
Message-ID: <ZNOBPHRMdVGRayV9@stargrave.org> (raw)
In-Reply-To: <87pm4yjz3t.fsf@complete.org>

[-- Attachment #1: Type: text/plain, Size: 1608 bytes --]

Greetings!

*** John Goerzen [2023-07-11 09:28]:
>First, nncp-xfer (and all the others, nncp-call, caller, daemon, bundle,
>etc) could have a -ack mode that will cause it to automatically generate
>an ack after successful receipt of a packet, eliminating the nncp-toss
>race condition.  (Or maybe it would make more sense to put this in toss?
>But there I think it would be more easy to generate multiple ACKs)

I am afraid I dislike all those ideas unfortunately, basically because
of non-atomic operations.

If "nncp-xfer -rx" will generate ACK packet, then what if something will
go wrong and outbound ACK packet could not be saved? We loose that ACK
and our running nncp-toss can already toss retrieved packet. -xfer +
-ack + -toss guarantees that if -ack will fail, then no packet will
disappear because of tossing. We can rerun -ack and be sure that ACKs
are generated (or will catch some error again (missing free disk space
for example)), and only after that we will toss them. So that won't
eliminate the race between reception and tossing.

>Then, nncp-xfer -tx could have a -keepexceptacks or something, that would
>cause it to keep all packets it sends, EXCEPT for the acks.

Unfortunately it can not, because -xfer sees only already encrypted
packets, which lacks packet type identification. It does not know what
it transfers. Or we have to keep some state, list of encrypted ACK
packets that can be safely removed, that leads to current workflow again.

-- 
Sergey Matveev (http://www.stargrave.org/)
OpenPGP: 12AD 3268 9C66 0D42 6967  FD75 CB82 0563 2107 AD8A

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

  parent reply	other threads:[~2023-08-09 12:06 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-11 14:28 Suggestions to make ACK easier John Goerzen
2023-07-11 15:55 ` John Goerzen
2023-07-30  7:47 ` Sergey Matveev
2023-08-09 12:04 ` Sergey Matveev [this message]
2023-08-10  2:04   ` John Goerzen
2023-08-13 20:30     ` Sergey Matveev
2023-09-13 17:29       ` John Goerzen