Skip to content
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

Fix #375 (I think) #434

Merged
merged 1 commit into from
Jan 19, 2023
Merged

Fix #375 (I think) #434

merged 1 commit into from
Jan 19, 2023

Conversation

zenhack
Copy link
Contributor

@zenhack zenhack commented Jan 19, 2023

This addresses #375; the now-deleted comment about the time gap being OK has been incorrect at least since we started handling receiverAnswers specially; the test that was failing was one where a reference to an answer's promise filed (and transitively pcall) is handed to a method implementation.

This patch avoids having a gap where pcall & promise are nil by:

  • Changing setPipelineCaller so it can be called before we release the lock
  • Introducing a stand-in type for the pipeline caller that we can set pcall to while the RecvCall is ongoing.

Before fixing the bug it took many thousands or tens of thousands of test runs to trigger it, so while I have not been able to reproduce the issue after tens of thousands of runs, that alone is inconclusive -- but I think this fixes the bug. It definitely fixes something.

This addresses capnproto#375; the now-deleted comment about the time gap being OK
has been incorrect at least since we started handling `receiverAnswer`s
specially; the test that was failing was one where a reference to an
answer's promise filed (and transitively pcall) is handed to a method
implementation.

This patch avoids having a gap where pcall & promise are nil by:

- Changing setPipelineCaller so it can be called before we release the
  lock
- Introducing a stand-in type for the pipeline caller that we can set
  pcall to while the RecvCall is ongoing.

Before fixing the bug it took many thousands or tens of thousands of
test runs to trigger it, so while I have not been able to reproduce the
issue after tens of thousands of runs, that alone is inconclusive -- but
I *think* this fixes the bug. It definitely fixes something.
@zenhack
Copy link
Contributor Author

zenhack commented Jan 19, 2023

Issue #426, re-running

@zenhack
Copy link
Contributor Author

zenhack commented Jan 19, 2023

Same thing. Going to just merge and then work on #426 next.

@zenhack zenhack merged commit 69ea88a into capnproto:main Jan 19, 2023
@zenhack zenhack deleted the fix-375 branch January 19, 2023 22:00
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