Skip to content

Conversation

@howardjohn
Copy link
Collaborator

see #504

@howardjohn howardjohn requested a review from a team as a code owner October 7, 2025 23:07
Copilot AI review requested due to automatic review settings October 7, 2025 23:07
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Increases the HTTP/1.1 idle timeout from the default 30 seconds to 10 minutes to prevent premature connection timeouts for long-running requests.

  • Added a configurable http1IdleTimeout parameter with a default value of 10 minutes
  • Modified connection handling to suppress timeout error logging for idle connection closures
  • Updated the hyper server configuration to use the new timeout value

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
schema/local.json Adds schema definition and default value for the new http1IdleTimeout parameter
schema/README.md Documents the new http1IdleTimeout configuration option
crates/agentgateway/src/proxy/gateway.rs Updates server configuration and error handling for idle timeouts
crates/agentgateway/src/lib.rs Defines the new configuration field with Duration type and default value

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

return Ok(());
}
}
anyhow::bail!("e");
Copy link

Copilot AI Oct 7, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The error message is hardcoded as 'e' instead of using the actual error. This should be anyhow::bail!(\"{e:?}\"); to preserve the original error information.

Suggested change
anyhow::bail!("e");
anyhow::bail!("{e:?}");

Copilot uses AI. Check for mistakes.
b.http1().max_headers(*m);
}
b.http1().header_read_timeout(Some(Duration::from_secs(2)));
b.http1().header_read_timeout(Some(*http1_idle_timeout));
Copy link

Copilot AI Oct 7, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The header_read_timeout method is being used with the idle timeout value, but this appears to be semantically incorrect. Header read timeout should remain a short duration (like the original 2 seconds) for security reasons, while idle timeout should be configured separately using http1().keep_alive() or similar methods.

Suggested change
b.http1().header_read_timeout(Some(*http1_idle_timeout));
b.http1().header_read_timeout(Some(std::time::Duration::from_secs(2)));
b.http1().keep_alive(Some(*http1_idle_timeout));

Copilot uses AI. Check for mistakes.
@howardjohn howardjohn force-pushed the http/increase-idle-timeout branch from 0c97b7d to 4934321 Compare October 7, 2025 23:34
@howardjohn howardjohn merged commit 590039b into agentgateway:main Oct 7, 2025
7 checks passed
@howardjohn howardjohn changed the title http: increase idle timeout from 30s to 10min http: increase idle timeout from 2s to 10min Oct 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant