-
-
Notifications
You must be signed in to change notification settings - Fork 107
fix: unblock local puts without downstream ack #2089
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
| origin: origin.clone(), | ||
| }); | ||
| // When we're the origin node we already seeded the contract locally. | ||
| // Treat downstream SuccessfulPut messages as best-effort so River is unblocked. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
River is just one application, I dlnt think we need to mention it here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think best effort for puts is basically lying to the application and is not a good design. If I am doing a put I expect it to be available in the network otherwise I would prefer to get a clear error code which says what is failing.
But that is me.
|
@iduartgomez I understand the concern about misleading applications, but I think best-effort is the right model here. The issue: Even if we waited for downstream acks (and even if all of them responded), that still doesn't guarantee retrievability. Those peers could crash, network could partition, etc. The guarantee is weak regardless. What actually happens: Origin caches locally and sends SeekNode. Propagation continues in background. Waiting for acks doesn't make data more available - it just blocks the caller on network timing. The semantics: PUT success means "I've accepted your data and started propagation," not "N replicas confirmed and retrievable." Applications that need stronger guarantees should verify via GET or track subscription updates. Error codes: We still surface real failures (invalid contract, local storage failed). We're just not treating "downstream didn't ack yet" as a failure when propagation is ongoing. Thoughts? |
|
I think there are two distinct categories between not eaiting for acks but the network works so at least I could initialize a put and the network is not working at all, but I cache locally and finalize the operation successfully. The second seems misleading to me completely no? |
|
@iduartgomez Good distinction. You're right - those are two different scenarios: Case 1: Network works, don't wait for acks
Case 2: Network completely down
Proposed fix: Return an error in case 2. When no peers are reachable, fail with something like This makes PUT semantics: "I've cached locally AND initiated network propagation" - both must succeed. Does that address your concern? |
|
Sounds good. |
Summary
SuccessfulPutfrom downstream peers is treated as best-effort acknowledgement. This fixes River/RPC callers hanging when remote gateways can’t dial the ephemeral callback port.subscribe=true, spin up the subscription child op right away (unless the parent already failed) so publish flows still attach live updates even without the downstream ack.riverctl room createreturns immediately), while freenet 0.1.37 reproduces the old timeout/contract-missing errors.Testing