handler: bound each Page command by HandlerConfig::request_timeout - #336
Open
URootX wants to merge 1 commit into
Open
handler: bound each Page command by HandlerConfig::request_timeout#336URootX wants to merge 1 commit into
URootX wants to merge 1 commit into
Conversation
CommandFuture hard-coded REQUEST_TIMEOUT (30 s) regardless of the configured request_timeout, which only drove eviction. Thread the per-target value through PageHandle -> PageInner -> CommandFuture::new so a caller that configures a longer timeout actually gets it (e.g. Runtime.evaluate awaiting a promise that settles after 30 s). Default behaviour is unchanged. Generated with [Claude Code](https://claude.ai/code) via [Happy](https://happy.engineering) Co-Authored-By: Claude <noreply@anthropic.com> Co-Authored-By: Happy <yesreply@happy.engineering>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
CommandFuture::newstarts its timer from the hard-codedhandler::REQUEST_TIMEOUT(30 s) regardless of what the caller put inHandlerConfig::request_timeout. The configured value only drives the periodic eviction of unanswered commands, so aPage::executethat Chrome legitimately answers after 30 s always fails withCdpError::Timeout— for example aRuntime.evaluatewithawaitPromise: truewhose promise settles at 35 s, even withrequest_timeoutset to minutes.Fix
Thread the per-target
request_timeout(already carried inTargetConfig) throughPageHandle::new→PageInner→CommandFuture::new, and use it for thefutures_timer::Delay.REQUEST_TIMEOUTstays as the default, so behaviour is unchanged for callers who never touch the config.src/handler/commandfuture.rs:CommandFuture::newtakesrequest_timeout: Duration.src/handler/page.rs:PageHandle::newtakes it and stores it onPageInner;command_futurepasses it on.src/handler/target.rs: passself.config.request_timeoutwhen the page handle is created.Browser::execute(browser-level commands) is untouched — it has no per-command timer today.Verification
cargo check/cargo test -p chromiumoxideon this branch. Exercised end to end from a daemon that setsrequest_timeoutto 180 s: aRuntime.evaluatethat takes 40 s now returns its value; onmainthe same call fails at 30 s withRequest timed out.