Fix timeout in poll_oneoff#1980
Merged
wenyongh merged 8 commits intobytecodealliance:mainfrom Feb 23, 2023
Merged
Conversation
ce5bd0c to
9bedc46
Compare
wenyongh
reviewed
Feb 22, 2023
wenyongh
reviewed
Feb 22, 2023
eloparco
commented
Feb 22, 2023
1a684af to
b8067df
Compare
94be0a5 to
d104f4e
Compare
hritikgupta
reviewed
Feb 22, 2023
972049e to
a60167c
Compare
406cf99 to
c020326
Compare
c020326 to
e3823f4
Compare
wenyongh
reviewed
Feb 22, 2023
vickiegpt
pushed a commit
to vickiegpt/wamr-aot-gc-checkpoint-restore
that referenced
this pull request
May 27, 2024
…ytecodealliance#1980) Fix issues in the libc-wasi `poll_oneoff` when thread manager is enabled: - The exception of a thread may be cleared when other thread runs into `proc_exit` and then calls `clear_wasi_proc_exit_exception`, so should not use `wasm_runtime_get_exception` to check whether an exception was thrown, use `wasm_cluster_is_thread_terminated` instead - We divided one time poll_oneoff into many times poll_oneoff to check the exception to avoid long time waiting in previous PR, but if all events returned by one time poll are all waiting events, we need to continue to wait but not return directly. Follow-up on bytecodealliance#1951. Tested with multiple timeout values, with and without interruption and measured the time spent sleeping.
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.
Two fixes in the
poll_oneoffimplementation:wasm_runtime_get_exception()was being called after theproc_exitexception was clearedwasm-micro-runtime/core/iwasm/common/wasm_runtime_common.c
Line 1870 in bb56298
therefore it was always returning
NULL;suspend_flagsshould be used instead to check for termination;elapsedwas incremented before the call towasmtime_ssp_poll_oneoff()Follow-up on #1951. Tested with multiple timeout values, with and without interruption and measuring the time spent sleeping.