[TT-12339] [BE] Implement sub-second timeout for the Enforced Timeout middleware#8151
Conversation
|
This pull request introduces sub-second precision for the Enforced Timeout middleware. It adds a new To ensure older systems continue to function, when Files Changed Analysis
Architecture & Impact Assessment
Request Flow with Sub-Second TimeoutsequenceDiagram
participant Client
participant Tyk Gateway
participant Upstream Service
Client->>+Tyk Gateway: HTTP Request
Tyk Gateway->>Tyk Gateway: GetHardTimeoutEnforcedSettings()
Note right of Tyk Gateway: Reads API spec for the matching path,<br/>retrieves timeout_duration (e.g., "500ms")
Tyk Gateway->>Tyk Gateway: context.WithTimeout(req.Context(), 500ms)
Tyk Gateway->>+Upstream Service: Forwards request with new timed context
alt Upstream takes > 500ms
Upstream Service-->>-Tyk Gateway: (No response within 500ms)
Note left of Upstream Service: Gateway's context deadline is exceeded
Tyk Gateway-->>-Client: HTTP 504 Gateway Timeout
else Upstream takes < 500ms
Upstream Service-->>-Tyk Gateway: HTTP 200 OK
Tyk Gateway-->>-Client: HTTP 200 OK
end
Scope Discovery & Context Expansion
Metadata
Powered by Visor from Probelabs Last updated: 2026-05-15T11:51:47.727Z | Triggered by: pr_updated | Commit: b7f550b 💡 TIP: You can chat with Visor using |
Security Issues (1)
✅ Performance Check PassedNo performance issues found – changes LGTM. Powered by Visor from Probelabs Last updated: 2026-05-15T11:51:27.689Z | Triggered by: pr_updated | Commit: b7f550b 💡 TIP: You can chat with Visor using |
…or-the-enforced-timeout-middleware
…or-the-enforced-timeout-middleware
…or-the-enforced-timeout-middleware
…or-the-enforced-timeout-middleware
…or-the-enforced-timeout-middleware
…or-the-enforced-timeout-middleware
…or-the-enforced-timeout-middleware
…-timeout-for-the-enforced-timeout-middleware' into TT-12339-be-implement-sub-second-timeout-for-the-enforced-timeout-middleware
…or-the-enforced-timeout-middleware
🎯 Recommended Merge TargetsBased on JIRA ticket TT-12339: [BE] Implement sub-second timeout for the Enforced Timeout middleware Fix Version: Tyk 5.14.0
Required:
📋 Workflow
|
…or-the-enforced-timeout-middleware
…or-the-enforced-timeout-middleware
🚨 Jira Linter FailedCommit: The Jira linter failed to validate your PR. Please check the error details below: 🔍 Click to view error detailsNext Steps
This comment will be automatically deleted once the linter passes. |
|



Description
Related Issue
Motivation and Context
How This Has Been Tested
Screenshots (if appropriate)
Types of changes
Checklist
Ticket Details
TT-12339
Generated at: 2026-05-15 11:50:18