#1687 Return 504 Gateway Timeout for downstream request timeouts according to RFC 9110 by rodri-oliveira-dev · Pull Request #2420 · ThreeMammals/Ocelot · GitHub
Skip to content

#1687 Return 504 Gateway Timeout for downstream request timeouts according to RFC 9110 - #2420

Merged
raman-m merged 5 commits into
ThreeMammals:developfrom
rodri-oliveira-dev:bug/1687-gateway-timeout
Aug 31, 2026
Merged

#1687 Return 504 Gateway Timeout for downstream request timeouts according to RFC 9110#2420
raman-m merged 5 commits into
ThreeMammals:developfrom
rodri-oliveira-dev:bug/1687-gateway-timeout

Conversation

@rodri-oliveira-dev

@rodri-oliveira-dev rodri-oliveira-dev commented Aug 29, 2026

Copy link
Copy Markdown
Contributor

Fixes #1687

Proposed Changes

  • return 504 Gateway Timeout when Ocelot times out waiting for a downstream response
  • keep client cancellation behavior unchanged
  • preserve existing QoS/Circuit Breaker behavior
  • update related tests and documentation

Validation

  • dotnet test unit/Ocelot.UnitTests.csproj --no-build --filter FullyQualifiedName~HttpExceptionToErrorMapperTests
  • dotnet test unit/Ocelot.UnitTests.csproj --no-build --filter FullyQualifiedName~ErrorsToHttpStatusCodeMapperTests
  • dotnet test unit/Ocelot.UnitTests.csproj --no-build --filter FullyQualifiedName~CircuitBreakerDelegatingHandlerTests
  • dotnet test acceptance/Ocelot.Acceptance.csproj --framework net8.0 --filter FullyQualifiedName~TimeoutTests -p:UseSharedCompilation=false
  • dotnet test acceptance/Ocelot.Acceptance.csproj --framework net9.0 --filter FullyQualifiedName~TimeoutTests -p:UseSharedCompilation=false
  • dotnet test acceptance/Ocelot.Acceptance.csproj --framework net10.0 --filter FullyQualifiedName~TimeoutTests -p:UseSharedCompilation=false
  • dotnet test acceptance/Ocelot.Acceptance.csproj --framework net8.0 --filter FullyQualifiedName~Should_timeout_per_default_after_90_seconds -p:UseSharedCompilation=false
  • dotnet test acceptance/Ocelot.Acceptance.csproj --framework net9.0 --filter FullyQualifiedName~Should_timeout_per_default_after_90_seconds -p:UseSharedCompilation=false
  • dotnet test acceptance/Ocelot.Acceptance.csproj --framework net10.0 --filter FullyQualifiedName~Should_timeout_per_default_after_90_seconds -p:UseSharedCompilation=false
  • dotnet test unit/Ocelot.UnitTests.csproj --no-build --culture en-US --parallel none
  • git diff --check

Notes

  • dotnet test from the repository root does not execute because multiple solution files exist.
  • dotnet test Ocelot.slnx is blocked before test execution because benchmark/Ocelot.Benchmarks.csproj uses VSTest while global.json requires Microsoft.Testing.Platform.
  • Full acceptance on net8 reproduced one unrelated local failure in ClientWebSocketTests.Http20ClientWhenDirectConnectionThenShouldConnect.

@codecov

codecov Bot commented Aug 30, 2026

Copy link
Copy Markdown

@coveralls

coveralls commented Aug 30, 2026

Copy link
Copy Markdown
Collaborator

Coverage Status

coverage: 97.098% (+0.03%) from 97.07% — rodri-oliveira-dev:bug/1687-gateway-timeout into ThreeMammals:develop

@raman-m raman-m added Requester Ocelot feature: Requester Responder Ocelot feature: Responder Error Handling Ocelot feature: Error Handling Autumn'26 Autumn 2026 release labels Aug 30, 2026
@raman-m raman-m added this to the Autumn'26 milestone Aug 30, 2026

@raman-m raman-m left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Ready for delivery ✅

  • Code review ✔️
  • Updated unit tests ✔️
  • Reviewed acceptance tests ✔️ new tests were not required
  • Updated docs ✔️ ✔️

@raman-m raman-m added this to RFC 9110 Aug 31, 2026
@github-project-automation github-project-automation Bot moved this to Todo in RFC 9110 Aug 31, 2026
@raman-m raman-m moved this from Todo to In Progress in RFC 9110 Aug 31, 2026
@raman-m raman-m changed the title #1687 Return 504 Gateway Timeout for downstream request timeouts #1687 Return 504 Gateway Timeout for downstream request timeouts according to RFC 9110 Aug 31, 2026
@raman-m
raman-m merged commit 8646f48 into ThreeMammals:develop Aug 31, 2026
4 checks passed
@github-project-automation github-project-automation Bot moved this from In Progress to Done in RFC 9110 Aug 31, 2026
@raman-m

raman-m commented Aug 31, 2026

Copy link
Copy Markdown
Member

@rodri-oliveira-dev Rodrigo,
Congrats on the first contribution! 🥳 and Welcome to the Ocelot community! 🎉

I'm curious, how do you use Ocelot in your projects?

@rodri-oliveira-dev

Copy link
Copy Markdown
Contributor Author

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.

@raman-m

raman-m commented Aug 31, 2026

Copy link
Copy Markdown
Member

@rodri-oliveira-dev
rodri-oliveira-dev deleted the bug/1687-gateway-timeout branch August 31, 2026 16:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Autumn'26 Autumn 2026 release Error Handling Ocelot feature: Error Handling Requester Ocelot feature: Requester Responder Ocelot feature: Responder

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

HTTP status 499 seems inappropriate when gateway times out waiting on server

3 participants