-
-
Notifications
You must be signed in to change notification settings - Fork 110
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
Clarify comments #308
Merged
Merged
Clarify comments #308
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This is depended upon in a few places, and from what I can tell is in fact satisfied by all implementations. But it wasn't documented.
zenhack
added a commit
to zenhack/go-capnp
that referenced
this pull request
Sep 26, 2022
Documentation added in capnproto#308 makes this redundant; the ReleaseFuncs returned by the transport already releases any caps in the message, and in all cases this was called immediately before releasing the message as a whole. Not doing this at every call site will make things less brittle. Note that there is no functional change here, in particular this is not fixing a double free bug: since clearCapTable sets CapTable to nil, it doesn't clash with the call to msg.Reset in the ReleaseFunc.
Merged
zenhack
added a commit
to zenhack/go-capnp
that referenced
this pull request
Sep 30, 2022
For two reasons: 1. As clarified in capnproto#308, the transport will release these when the message is freed, so we don't need to do this here to avoid a leak, and letting the transport deal with it is simpler. 2. I smell a race condition: this releases the clients before the message is actually on the wire. I *think* it is actually fine, because I think by this time the message is already in the queue and so is morally on the wire, but it's a bit harder to reason about, and makes me nervous. I *believe* there is no functional change here.
zenhack
added a commit
to zenhack/go-capnp
that referenced
this pull request
Sep 30, 2022
For two reasons: 1. As clarified in capnproto#308, the transport will release these when the message is freed, so we don't need to do this here to avoid a leak, and letting the transport deal with it is simpler. 2. I smell a race condition: this releases the clients before the message is actually on the wire. I *think* it is actually fine, because I think by this time the message is already in the queue and so is morally on the wire, but it's a bit harder to reason about, and makes me nervous. I *believe* there is no functional change here.
lthibault
approved these changes
Sep 30, 2022
zenhack
added a commit
to zenhack/go-capnp
that referenced
this pull request
Sep 30, 2022
For two reasons: 1. As clarified in capnproto#308, the transport will release these when the message is freed, so we don't need to do this here to avoid a leak, and letting the transport deal with it is simpler. 2. I smell a race condition: this releases the clients before the message is actually on the wire. I *think* it is actually fine, because I think by this time the message is already in the queue and so is morally on the wire, but it's a bit harder to reason about, and makes me nervous. I *believe* there is no functional change here.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
While picking through the code trying to solve #306, I discovered a few bits of the API that were not adequately documented, so I fixed the docs. See individual commits.