xia-chao opened issue #15112:
wasmtime serve -W timeout=0or--post-return-timeout 0burns 100-220% CPU (same server without the flag: ~5%). A zero timeout makes the epoch interval zero (serve.rs:746), soEpochThreadloops onsleep(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>, thenps -o %CPU -p <pid>.
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.
pchickey commented on issue #15112:
I would accept a patch that adds a clap value parser to reject zero values for those - a
NonZeroDurationParserbuilt in this style, fortype Value = Duration;and excluding the case equal to Duration::new(0,0)
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
NonZeroDurationParserbuilt in this style, fortype Value = Duration;and rejecting the case equal to Duration::new(0,0).
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
NonZeroDurationParserbuilt in this style, fortype Value = Duration;and rejecting the case equal toDuration::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.
pchickey closed issue #15112:
wasmtime serve -W timeout=0or--post-return-timeout 0burns 100-220% CPU (same server without the flag: ~5%). A zero timeout makes the epoch interval zero (serve.rs:746), soEpochThreadloops onsleep(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>, thenps -o %CPU -p <pid>.
Last updated: Nov 19 2026 at 20:05 UTC