Skip to content

Simplify clientHook's refcounting scheme. #496

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

Closed
wants to merge 7 commits into from

Conversation

zenhack
Copy link
Contributor

@zenhack zenhack commented Apr 1, 2023

There is no actual reason why we need separate refcounts for calls and clients. In preparation for generally unifying the refcounting in this library, I've decided we should just merge them.

There is no actual reason why we need separate refcounts for calls and
clients. In preparation for generally unifying the refcounting in this
library, I've decided we should just merge them.
lthibault
lthibault previously approved these changes Apr 1, 2023
Copy link
Collaborator

@lthibault lthibault left a comment

Choose a reason for hiding this comment

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

LGTM. Note that I have not looked at CI failure.

zenhack added 4 commits April 9, 2023 21:00
...because fewer special cases are better. This also resolves everything
but the documentation for capnproto#423.

One of the tests had to be reworked a bit because the exact sequence of
messages was a bit different, but still correct.
@zenhack
Copy link
Contributor Author

zenhack commented Apr 12, 2023

I merged in #502, which fixed the test failures locally, so hopefully it should do so in CI as well. That PR should be reviewed & merged first.

@zenhack
Copy link
Contributor Author

zenhack commented Apr 12, 2023

#348, re-running.

lthibault
lthibault previously approved these changes Apr 12, 2023
Copy link
Collaborator

@lthibault lthibault left a comment

Choose a reason for hiding this comment

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

Approved (pending questions in #502)

This can't possibly have any effect, since we close the same channel
immediately above. The close used to be conditional, so it presumably
made more sense then.
@zenhack
Copy link
Contributor Author

zenhack commented Apr 15, 2023

Per my long rambly rubber-ducking session on matrix, there is a reason for having two separate refcounts: if refs hits zero Client.Release() will block on calls hitting zero before returning. This patch breaks that, oops. Closing.

@zenhack zenhack closed this Apr 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants