-
Notifications
You must be signed in to change notification settings - Fork 15
Refactor poll_oneoff on *nix #137
Conversation
|
OK, this PR is ready for review. Additionally, this PR is blocked by CraneStation/wasi-misc-tests#38 (i.e., it really should include |
This PR updates `wasmtime_wasi` crate by adjusting `poll_oneoff`'s signature to that introduced in `wasi_common` in CraneStation/wasi-common#137. This change is required in order to fix #440.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I closed #140, let's keep all the refactoring in one PR.
That's my bad at poorly synchronising efforts between the two of us. Apologies! |
|
@kubkon can we have a more descriptive PR title? |
This commit introduces a couple of changes/fixes: * it annotates `log::debug!` messages with "host" to differentiate between file descriptors stored on the WASI side (aka the wrappers) and those managed by the host (aka the wrapped) * it fixes bytecodealliance/wasmtime#440, i.e., incorrect passing of file descriptor to `poll_oneoff` where currently errenously we pass in the wrapper instead of the wrapped value * it adds a couple more `log::debug!` macros calls for easier future debugging
This commit lays the groundwork for more clean up to come in subsequent commits.
Co-authored-by: Marcin Mielniczuk <[email protected]>
Instead of converting the timeout value from nanoseconds to milliseconds in the host-independent impl, move the conversion to *nix-specific impl as the conversion is currently only warranted by the POSIX `poll` syscall.
If the user specifies an invalid descriptor inside a subscription, don't fail immediately but rather generate an event with the thrown WASI error code, and continue with the remaining, potentially correct subscriptions.
|
I think we're in a pretty good shape with this now, so I'm gonna go ahead and merge this. If you guys feel that we should still modify something, or something isn't clear, please feel free to submit an issue, and I'll be happy to fix anything that is remaining :-) |
This PR introduces a couple of changes/fixes:
log::debug!messages with "host" to differentiatebetween file descriptors stored on the WASI side (aka the wrappers)
and those managed by the host (aka the wrapped)
file descriptor to
poll_oneoffwhere currently errenously wepass in the wrapper instead of the wrapped value
log::debug!macros calls for easier futuredebugging
poll_oneofffor easier maintenance in the future (hopefully!)