-
Notifications
You must be signed in to change notification settings - Fork 97
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Issue with monotonic clocks #103
Comments
currently only the realtime clock is supported on cpp-host implementation, but it's easy to implement. let me handle this. |
Great! But does that mean I have to wait until the next Envoy release (or compile myself) to get the fix? |
Correct, there is no way to get monotonic clock right now. |
here it is: proxy-wasm/proxy-wasm-cpp-host#156 |
A temporary workaround for this was added to the coarsetime crate. I'm going to tag a new version shortly, so that people can use code depending on it with the current version of Envoy. Edit: Done. |
Supports clock_time_get in WASI with monotonic clock_id. Ref: proxy-wasm/proxy-wasm-cpp-host#156 and proxy-wasm/proxy-wasm-rust-sdk#103 Signed-off-by: Takeshi Yoneda <takeshi@tetrate.io>
Hi, first thank you for this great project! I am having an issue with a filter targeting wasm32-wasi. When using code like:
std::time::Instant::now()
orwasi::clock_time_get(CLOCKID_MONOTONIC, 1_000_000)
I get the following panic:
proxy_1 | [2021-04-25 19:52:37.278][8][critical][wasm] [source/extensions/common/wasm/context.cc:1180] wasm log: panicked at 'called
Result::unwrap()on an
Errvalue: Error { code: 58, message: "Not supported, or operation not supported on socket." }', library/std/src/sys/wasi/time.rs:18:10
Seems like monotonic ClockId is not supported in Envoy host environment? Are you aware of this issue and do you know of any solution? I am aware that there is a proxy specific hostcall to get time, but I am depending on Json Web Token libraries that require monotonic clocks.
Example JWT library code for wasi target:
The text was updated successfully, but these errors were encountered: