Stream: git-wasmtime

Topic: wasmtime / PR #7144 Fix race condition in `AsyncWriteStream`


view this post on Zulip Wasmtime GitHub notifications bot (Oct 03 2023 at 19:31):

alexcrichton opened PR #7144 from alexcrichton:fix-flaky-test to bytecodealliance:main:

This commit fixes a synchronization issue with AsyncWriteStream where the writer task would get wedged and not make any further progress. The underlying reason is that notify_waiters was used which did not buffer its notification, meaning that if a waiter wasn't actually waiting then it would miss the notification and block forever on the next call to notified. By using notify_one instead this will buffer up a single notification for the other end for when it gets to waiting for work.

Additionally this removes creation of the Notified future ahead-of-time as that's no longer necessary.

<!--
Please make sure you include the following information:

Our development process is documented in the Wasmtime book:
https://docs.wasmtime.dev/contributing-development-process.html

Please ensure all communication follows the code of conduct:
https://github.com/bytecodealliance/wasmtime/blob/main/CODE_OF_CONDUCT.md
-->

view this post on Zulip Wasmtime GitHub notifications bot (Oct 03 2023 at 19:31):

alexcrichton requested elliottt for a review on PR #7144.

view this post on Zulip Wasmtime GitHub notifications bot (Oct 03 2023 at 19:31):

alexcrichton requested wasmtime-core-reviewers for a review on PR #7144.

view this post on Zulip Wasmtime GitHub notifications bot (Oct 03 2023 at 19:31):

alexcrichton requested fitzgen for a review on PR #7144.

view this post on Zulip Wasmtime GitHub notifications bot (Oct 03 2023 at 19:58):

fitzgen submitted PR review.

view this post on Zulip Wasmtime GitHub notifications bot (Oct 03 2023 at 19:58):

elliottt submitted PR review:

Looks good to me! The difference in behavior between those two similarly named functions is unfortunate, thanks for catching this!

view this post on Zulip Wasmtime GitHub notifications bot (Oct 03 2023 at 19:59):

alexcrichton updated PR #7144.

view this post on Zulip Wasmtime GitHub notifications bot (Oct 03 2023 at 19:59):

alexcrichton has enabled auto merge for PR #7144.

view this post on Zulip Wasmtime GitHub notifications bot (Oct 03 2023 at 21:20):

alexcrichton merged PR #7144.


Last updated: Nov 22 2024 at 17:03 UTC