#1687 Return 504 Gateway Timeout for downstream request timeouts according to RFC 9110 - #2420
Conversation
raman-m
left a comment
There was a problem hiding this comment.
Ready for delivery ✅
- Code review ✔️
- Updated unit tests ✔️
- Reviewed acceptance tests ✔️ new tests were not required
- Updated docs ✔️ ✔️
|
@rodri-oliveira-dev Rodrigo, I'm curious, how do you use Ocelot in your projects? |
|
Thanks, Raman! I really appreciate the welcome! It was a pleasure contributing to Ocelot. I mainly use Ocelot in .NET-based distributed systems as a lightweight API Gateway, especially to centralize concerns such as routing, authentication/authorization, downstream service integration, resiliency, and consistent HTTP behavior. From an architecture perspective, I’m particularly interested in how the gateway handles failure semantics, timeouts, cancellation propagation, observability/correlation, and resilience patterns. That was actually what caught my attention in #1687 — small differences in how gateway failures are represented can have a significant impact on clients, monitoring, and operational troubleshooting. I’m looking forward to contributing more to the project. |

Fixes #1687
Proposed Changes
Validation
dotnet test unit/Ocelot.UnitTests.csproj --no-build --filter FullyQualifiedName~HttpExceptionToErrorMapperTestsdotnet test unit/Ocelot.UnitTests.csproj --no-build --filter FullyQualifiedName~ErrorsToHttpStatusCodeMapperTestsdotnet test unit/Ocelot.UnitTests.csproj --no-build --filter FullyQualifiedName~CircuitBreakerDelegatingHandlerTestsdotnet test acceptance/Ocelot.Acceptance.csproj --framework net8.0 --filter FullyQualifiedName~TimeoutTests -p:UseSharedCompilation=falsedotnet test acceptance/Ocelot.Acceptance.csproj --framework net9.0 --filter FullyQualifiedName~TimeoutTests -p:UseSharedCompilation=falsedotnet test acceptance/Ocelot.Acceptance.csproj --framework net10.0 --filter FullyQualifiedName~TimeoutTests -p:UseSharedCompilation=falsedotnet test acceptance/Ocelot.Acceptance.csproj --framework net8.0 --filter FullyQualifiedName~Should_timeout_per_default_after_90_seconds -p:UseSharedCompilation=falsedotnet test acceptance/Ocelot.Acceptance.csproj --framework net9.0 --filter FullyQualifiedName~Should_timeout_per_default_after_90_seconds -p:UseSharedCompilation=falsedotnet test acceptance/Ocelot.Acceptance.csproj --framework net10.0 --filter FullyQualifiedName~Should_timeout_per_default_after_90_seconds -p:UseSharedCompilation=falsedotnet test unit/Ocelot.UnitTests.csproj --no-build --culture en-US --parallel nonegit diff --checkNotes
dotnet testfrom the repository root does not execute because multiple solution files exist.dotnet test Ocelot.slnxis blocked before test execution becausebenchmark/Ocelot.Benchmarks.csprojuses VSTest whileglobal.jsonrequires Microsoft.Testing.Platform.ClientWebSocketTests.Http20ClientWhenDirectConnectionThenShouldConnect.