⛽ -> ⏲️ Switch from fuel to epoch interruptions.#273
Merged
Conversation
Co-authored-by: Jamey Sharp <jsharp@fastly.com>
f98db2b to
fde3973
Compare
Contributor
Author
|
The test failed CI here, so I set it up to run 100 times locally, and it passed 72 times and failed 28 times. So definitely flaky. I'm still unsure why switching to epoch interruptions introduced the flakiness (or made failure more likely), but it seems like the move here is to introduce some backend synchronization mechanism to the test as described here |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR has two main parts:
lib/src/execute.rsandlib/src/linking.rs)async_io_methods, which broke as a result of the switch.The epoch switch is straightforward: set the config value on the wasmtime Engine and then attach a thread to the ExecuteCtx which increments the epoch every 50 µs. We also added a Drop implementation to
ExecuteCtxto join that thread.@jameysharp and I collaborated on chasing down the test issue, namely the
async_io_methodstest had a race condition (alluded to here) that required it to sleep for 100ms to give the backends time to work. The switch to epoch interruptions made that test flaky, so I added an additional backend and request to the test fixture as a synchronization mechanism between the guest and the server. Once the server has read enough bytes to relieve the backpressure on the write body, it will complete the sync request, signaling to the guest that the write body should be ready.