Skip to content

wasi: apply wasm_runtime_begin_blocking_op to poll as well#3080

Merged
wenyongh merged 1 commit intobytecodealliance:mainfrom
yamt:wasi-blocking-op-poll
Jan 25, 2024
Merged

wasi: apply wasm_runtime_begin_blocking_op to poll as well#3080
wenyongh merged 1 commit intobytecodealliance:mainfrom
yamt:wasi-blocking-op-poll

Conversation

@yamt
Copy link
Contributor

@yamt yamt commented Jan 24, 2024

While we used a different approach for poll_oneoff [1], the implementation works only when the poll list includes an absolute clock event. That is, if we have a thread which is polling on descriptors without a timeout, we fail to terminate the thread.

This commit fixes it by applying wasm_runtime_begin_blocking_op to poll as well.

[1] #1951

@yamt yamt force-pushed the wasi-blocking-op-poll branch 2 times, most recently from 40c94f4 to ae21cd2 Compare January 24, 2024 08:26
While we used a different approach for poll_oneoff [1],
the implementation works only when the poll list includes
an absolute clock event. That is, if we have a thread which is
polling on descriptors without a timeout, we fail to terminate
the thread.

This commit fixes it by applying wasm_runtime_begin_blocking_op
to poll as well.

[1] bytecodealliance#1951
@yamt yamt force-pushed the wasi-blocking-op-poll branch from ae21cd2 to e1e89bb Compare January 24, 2024 09:48
@yamt
Copy link
Contributor Author

yamt commented Jan 24, 2024

the ci failure looks unrelated.

 Download action repository 'actions/checkout@v3' (SHA:f43a0e5ff2bd294095638e18286ca9a3d1956744)
Download action repository 'actions/cache@v3' (SHA:e12d46a63a90f2fae62d114769bbf2a179198b5c)
Warning: Failed to download action 'https://api.github.com/repos/actions/cache/tarball/e12d46a63a90f2fae62d114769bbf2a179198b5c'. Error: nodename nor servname provided, or not known (api.github.com:443)
Warning: Back off 20.183 seconds before retry.
Warning: Failed to download action 'https://api.github.com/repos/actions/cache/tarball/e12d46a63a90f2fae62d114769bbf2a179198b5c'. Error: nodename nor servname provided, or not known (api.github.com:443)
Warning: Back off 10.301 seconds before retry.
Error: nodename nor servname provided, or not known (api.github.com:443)

Copy link
Collaborator

@wenyongh wenyongh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@wenyongh wenyongh merged commit 9afbeab into bytecodealliance:main Jan 25, 2024
vickiegpt pushed a commit to vickiegpt/wamr-aot-gc-checkpoint-restore that referenced this pull request May 27, 2024
…lliance#3080)

While we used a different approach for poll_oneoff [1],
the implementation works only when the poll list includes
an absolute clock event. That is, if we have a thread which is
polling on descriptors without a timeout, we fail to terminate
the thread.

This commit fixes it by applying wasm_runtime_begin_blocking_op
to poll as well.

[1] bytecodealliance#1951
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