Stream: git-wasmtime

Topic: wasmtime / issue #15112 serve: zero timeouts busy-spin th...


view this post on Zulip Wasmtime GitHub notifications bot (Nov 02 2026 at 12:13):

xia-chao opened issue #15112:

wasmtime serve -W timeout=0 or --post-return-timeout 0 burns 100-220% CPU (same server without the flag: ~5%). A zero timeout makes the epoch interval zero (serve.rs:746), so EpochThread loops on sleep(0) (serve.rs:1263).

Reject zero and sub-millisecond values, clamp the thread interval, or document 0 as "time out immediately"?

Repro: wasmtime serve -Scli --post-return-timeout 0 <component>, then ps -o %CPU -p <pid>.

view this post on Zulip Wasmtime GitHub notifications bot (Nov 02 2026 at 15:11):

alexcrichton commented on issue #15112:

Subjectively I think this is fine, it's a user-supplied parameter and you're getting what you configured. It's a bit odd but it feels a bit too niche to try and rule out.

view this post on Zulip Wasmtime GitHub notifications bot (Nov 03 2026 at 23:13):

pchickey commented on issue #15112:

I would accept a patch that adds a clap value parser to reject zero values for those - a NonZeroDurationParser built in this style, for type Value = Duration; and excluding the case equal to Duration::new(0,0)

view this post on Zulip Wasmtime GitHub notifications bot (Nov 03 2026 at 23:13):

pchickey edited a comment on issue #15112:

I would accept a patch that adds a clap value parser to reject zero values for those - a NonZeroDurationParser built in this style, for type Value = Duration; and rejecting the case equal to Duration::new(0,0).

view this post on Zulip Wasmtime GitHub notifications bot (Nov 03 2026 at 23:14):

pchickey edited a comment on issue #15112:

I would accept a patch that adds a clap value parser to reject zero values for those - a NonZeroDurationParser built in this style, for type Value = Duration; and rejecting the case equal to Duration::new(0,0).

To me this is a usability hint and not a correctness issue - as Alex says, you're getting what you configured, but some configurations don't make sense and we could tell the user that in the cli. In the API, the user gets what they asked for.

view this post on Zulip Wasmtime GitHub notifications bot (Nov 05 2026 at 22:23):

pchickey closed issue #15112:

wasmtime serve -W timeout=0 or --post-return-timeout 0 burns 100-220% CPU (same server without the flag: ~5%). A zero timeout makes the epoch interval zero (serve.rs:746), so EpochThread loops on sleep(0) (serve.rs:1263).

Reject zero and sub-millisecond values, clamp the thread interval, or document 0 as "time out immediately"?

Repro: wasmtime serve -Scli --post-return-timeout 0 <component>, then ps -o %CPU -p <pid>.


Last updated: Nov 19 2026 at 20:05 UTC