Skip to content

Fix broken implemenation of .Ack()#254

Merged
lthibault merged 2 commits into
capnproto:mainfrom
zenhack:fix-ack
Jul 11, 2022
Merged

Fix broken implemenation of .Ack()#254
lthibault merged 2 commits into
capnproto:mainfrom
zenhack:fix-ack

Conversation

@zenhack

@zenhack zenhack commented Jun 14, 2022

Copy link
Copy Markdown
Contributor

I apparently completely broke this when I reworked the server internals to use an unbounded queue, as a result of some convoluted shutdown logic.

The first commit adds a test, verifying that calling Ack() does indeed unblock future calls. The test deadlocks.

The second commit fixes the test, by replacing said convoluted shutdown logic with a more straightforward implementation that works.

The test currently deadlocks; the next commit will fix the issue.
lthibault
lthibault previously approved these changes Jul 3, 2022

@lthibault lthibault left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM. Merging.

@lthibault

Copy link
Copy Markdown
Collaborator

Whoops -- just realized the tests are failing. Is this expected?

Because the cancelCurrentCall channel has a fixed buffer size, if there
is an ongoing call, then trying to insert into this will block,
completely defeating .Ack().

This patch gets rid of the convoluted shutdown logic in favor of just
constructing an appropriate context which is tied to both parent
contexts. I'm not sure why I wrote it this way in the first place.
@zenhack

zenhack commented Jul 9, 2022

Copy link
Copy Markdown
Contributor Author

Fixed.

@lthibault lthibault merged commit 80b8f3c into capnproto:main Jul 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants