Skip to content

Conversation

@blovett-ec
Copy link

@blovett-ec blovett-ec commented Dec 15, 2025

  • Support changing of the global timeout values, for example when your client/server responses are less frequent than every 55s or 120s. Additionally allows the user to match the client/server timeouts when operating in TCP mode as recommended by haproxy here:

When operating HAProxy in TCP mode, which is set with mode tcp, timeout server should be the same as timeout client. That’s because HAProxy doesn’t know which side is supposed to be speaking and, since both apply all the time, having different values makes confusion more likely.

  • Update pre-existing documentation for metadata setting/updating to reflect the proper sub-command.

blovett-ec and others added 3 commits December 10, 2025 08:52
Allow users to customize HAProxy timeout values through the new
cloud.tritoncompute:timeouts metadata key. The format uses a JSON-like
syntax: {queue:0,connect:5000,client:60000,server:180000}

All timeout parameters are optional - unspecified values use defaults:
- queue: 0 (unlimited)
- connect: 2000ms
- client: 55000ms
- server: 120000ms

Changes:
- Add TIMEOUTS_KEY metadata constant
- Add TimeoutConfig struct and default constants
- Add parse_timeouts() function for parsing metadata
- Convert 001-defaults.cfg to Askama template for dynamic rendering
- Update configure_haproxy() to use dynamic defaults
- Add comprehensive unit tests for timeout parsing
- Add documentation in README.md

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <[email protected]>
@blovett-ec blovett-ec marked this pull request as ready for review December 15, 2025 22:57
@danmcd danmcd requested a review from a team December 16, 2025 15:23
@danmcd
Copy link
Contributor

danmcd commented Dec 16, 2025

Confirming: I see a Claude credit in this branch's first commit, so RFD 187 attribution applies, and you're taking responsibility for this, correct?

I've pinged @TritonDataCenter/triton-engineering for this. Also, I will be opening a TRITON- ticket. The lack of description here needs to be fixed, but the summary on this PR is perfect for said ticket. Anything in this PR's conversation that's ticket-pertinent will be pasted there. This will include test-notes and other things that would go in a ticket.

@danmcd danmcd changed the title Add support for configuring global timeouts via metadata MANTA-5495 Add support in CLB for configuring global timeouts via metadata Dec 16, 2025
@danmcd danmcd changed the title MANTA-5495 Add support in CLB for configuring global timeouts via metadata TRITON-2529 Add support in CLB for configuring global timeouts via metadata Dec 16, 2025
Added copyright notice for Edgecast Cloud LLC.
nshalman
nshalman previously approved these changes Dec 16, 2025
Copy link
Contributor

@nshalman nshalman left a comment

Choose a reason for hiding this comment

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

I am comfortable with this. Thank you!

@danmcd
Copy link
Contributor

danmcd commented Dec 16, 2025

@blovett-ec I will need the following put here for transfer into the ticket:

  • Why do we need this? IOW: What problem are you solving with this?

  • How you tested with some modicum of detail.

Copy link
Contributor

@danmcd danmcd left a comment

Choose a reason for hiding this comment

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

I've added what I think is a decent statement-of-problem-and-solution in the ticket. I will need your testing notes, esp. in light of comments below.

input.trim().eq_ignore_ascii_case("true")
}

/// Parse timeout overrides from metadata
Copy link
Contributor

Choose a reason for hiding this comment

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

Don't we have a Rust crate that'll do this for us? New parsing code feels like a place for security problems, even in a safer language like Rust.

Copy link
Contributor

Choose a reason for hiding this comment

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

@nshalman may be able to answer this better, esp. with our new Rust monorepo.

Copy link
Contributor

Choose a reason for hiding this comment

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

Possibly a case of, "yes, but it'd be like bringing an atom-bomb to a knife fight," scenario. Will let @nshalman confirm/deny and mark-as-resolved as appropriate.

danmcd
danmcd previously requested changes Dec 16, 2025
Copy link
Contributor

@danmcd danmcd left a comment

Choose a reason for hiding this comment

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

Forgot to check request-changes.

Copy link
Contributor

@danmcd danmcd left a comment

Choose a reason for hiding this comment

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

Removing my request-changes. Still have a question about json parsing, but less blocking.

@danmcd danmcd dismissed their stale review December 17, 2025 00:45

Reduced to JSON parser question.

- Change TimeoutConfig fields from u32 to std::time::Duration
- Support timeout value formats: plain number (ms), 'ms' suffix, 's' suffix
- Clamp client/server timeouts to maximum of 60 minutes
- Fail on invalid timeout values instead of falling back to defaults
- Add getter methods (queue_ms, etc.) for HAProxy template rendering

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <[email protected]>
blovett-ec and others added 2 commits December 17, 2025 09:54
Copy link
Contributor

@danmcd danmcd left a comment

Choose a reason for hiding this comment

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

My +1 stands even after cargo fmt.

input.trim().eq_ignore_ascii_case("true")
}

/// Parse timeout overrides from metadata
Copy link
Contributor

Choose a reason for hiding this comment

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

Possibly a case of, "yes, but it'd be like bringing an atom-bomb to a knife fight," scenario. Will let @nshalman confirm/deny and mark-as-resolved as appropriate.

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.

3 participants