Skip to content

feat: Add hard timeout functionality to Container class#85

Open
Talador12 wants to merge 1 commit into
cloudflare:mainfrom
Talador12:feature/hard-timeouts
Open

feat: Add hard timeout functionality to Container class#85
Talador12 wants to merge 1 commit into
cloudflare:mainfrom
Talador12:feature/hard-timeouts

Conversation

@Talador12
Copy link
Copy Markdown

  • Adds hardTimeout configuration option with duration parsing
  • Implements hard timeout timer that starts on container initialization
  • Hard timeout never resets (unlike soft timeout which resets on activity)
  • Provides onHardTimeoutExpired() hook for custom cleanup logic
  • Hard timeout takes precedence over soft timeout when both expire
  • Comprehensive test coverage including timeout interactions
  • Improved Jest configuration for Cloudflare Workers environment

@Talador12 Talador12 force-pushed the feature/hard-timeouts branch from 625cc69 to 2a1de0e Compare September 24, 2025 19:59
@Talador12 Talador12 requested a review from a team as a code owner September 24, 2025 19:59
@Talador12 Talador12 force-pushed the feature/hard-timeouts branch from 2a1de0e to 29024b5 Compare September 24, 2025 20:25
Adds support for a hard timeout on Container instances that fires
regardless of activity. Complements the existing inactivity timeout
(sleepAfter) by giving operators an upper bound on how long any one
container instance can run.

Squashed from 3 commits (initial impl + alarm-based -> native workerd
APIs migration + test compatibility).
@Talador12 Talador12 force-pushed the feature/hard-timeouts branch from fe1d51f to 4db5384 Compare April 28, 2026 18:49
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