Skip to content

[SVLS-10207] fix(flush): raise the end strategy timer to the 30-minute Lambda timeout - #1534

Open
lym953 wants to merge 1 commit into
mainfrom
yiming.luo/end-flush-30-min-timeout
Open

lym953 wants to merge 1 commit into
mainfrom
yiming.luo/end-flush-30-min-timeout

Conversation

@lym953

@lym953 lym953 commented Nov 19, 2026

Copy link
Copy Markdown
Collaborator

Problem

On 2026-11-19, AWS raised the maximum timeout of on-demand Lambda functions from 15 minutes to 30 minutes (AWS announcement).

A user who sets DD_SERVERLESS_FLUSH_STRATEGY=end expects the extension to send data only when each invocation ends. To make sure that no flush starts during the invocation, the extension sets a timer to the maximum Lambda timeout, 15 minutes. For an invocation longer than 15 minutes, the timer fires at minute 15. The extension then does one blocking flush while the handler runs.

This PR

  • Changes the timer of the end strategy from 15 minutes to 30 minutes.
  • Updates the README and the doc comment in the test-mode binary that give the value.

The 90-minute limit of Managed Instances does not apply. In that mode, the extension always replaces end with a continuous strategy.

Impact

This applies to a user of end with an invocation between 15 and 30 minutes. The extension keeps the data of the full invocation in memory until it ends. Before this change, the flush at minute 15 released it.

Testing

Steps

  1. cargo test --lib lifecycle::flush_control
  2. cargo clippy --all-targets

Result

Check Result
Flush control unit tests, which include the test of the end timer value 5 passed
Clippy No warnings in the extension code

I did not run an invocation longer than 15 minutes in Lambda.

🤖 Generated with Claude Code

…e Lambda timeout

AWS raised the maximum timeout of on-demand Lambda functions to 30 minutes.
The end flush strategy sets a timer to the maximum timeout so that it never
fires. With a 15-minute timer, an invocation longer than 15 minutes got a
blocking flush while the handler ran.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@lym953
lym953 marked this pull request as ready for review November 19, 2026 22:00
@lym953
lym953 requested a review from a team as a code owner November 19, 2026 22:00
@lym953
lym953 requested review from shreyamalpani and a balanced review from Copilot November 19, 2026 22:00
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 19, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-19T22:01:33.624614Z 80ac26c Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 Approval recommended

No active review issues were identified for the flush-strategy interval update.

No open issues 🎉

What changed in this PR

Updates the Lambda extension’s end flush strategy timer from 15 to 30 minutes to match the new maximum on-demand Lambda timeout and avoid a timer-triggered flush at minute 15.

Changes:

  • Raises the end strategy interval to 30 minutes and updates its unit-test expectation.
  • Aligns the README and test-mode doc comment with the new interval.
File Description
bottlecap/​src/​lifecycle/​flush_control.rs Updates the interval constant, explanatory comment, and unit-test expectation.
bottlecap/​src/​bin/​bottlecap-test-mode/​main.rs Updates the doc comment to describe the 30-minute placeholder interval.
bottlecap/​README.md Documents the new interval and its relation to the on-demand timeout.

Review effort: Balanced

@litianningdatadog

Copy link
Copy Markdown
Contributor

One potential impact of extending the flush interval is increased memory pressure. For example, the logs and trace aggregators both append to unbounded queues. Could we retain a periodic safety flush or add a buffer-size-triggered flush to reduce the risk of data loss or an out-of-memory failure?

@litianningdatadog litianningdatadog left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

left some comment

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