Skip to content
This repository has been archived by the owner on Sep 9, 2022. It is now read-only.

simplify generation of reservations #131

Merged
merged 2 commits into from
Jul 10, 2021

Conversation

marten-seemann
Copy link
Contributor

There's no need for this difficult to reason about rollback procedure. Difficult because it happens after the mutex is unlocked, so other Go routines might already have modified the maps.

Really, the only reason why writing the response would fail is that the stream was closed / reset by the peer. In that case the reservation would not be received by the peer. However, this can also happen for a number of other reasons, e.g. when the stream is reset after the response was written, if the peer disconnects before reading the message, and many others.

Copy link
Member

@Stebalien Stebalien left a comment

Choose a reason for hiding this comment

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

I think I get it. Basically, we don't care if the other side doesn't get the requested reservation. In that case, we'll just garbage collect it later.

Can we leave a comment explaining this?

@marten-seemann marten-seemann merged commit f612dea into circuit-v2 Jul 10, 2021
@marten-seemann marten-seemann deleted the simplify-handle-reserve branch July 10, 2021 19:18
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants