capnp-rpc icon indicating copy to clipboard operation
capnp-rpc copied to clipboard

[Tracking] Detect race resolving a promise

Open talex5 opened this issue 6 years ago • 0 comments

We sometimes don't unset the blocker flag quickly enough, and perform other processing first. This can make us briefly think that a promise is resolved when it isn't. The new test shows a case where this matters: we incorrectly export a capability as SenderHosted (settled) before the status gets updated. When we later try to resolve the promise, the remote side complains.

Add an assert to detect and report the problem earlier. This also triggers on existing test cases.

This PR only detects the bug; it does not fix it.

Bug found by AFL.

talex5 avatar Dec 29 '17 14:12 talex5