Skip to content

Opt-in to set Connection:Close on downstream requests#1441

Open
bjartekh wants to merge 6 commits intoThreeMammals:developfrom
bjartekh:feature/connection-close-opt-in
Open

Opt-in to set Connection:Close on downstream requests#1441
bjartekh wants to merge 6 commits intoThreeMammals:developfrom
bjartekh:feature/connection-close-opt-in

Conversation

@bjartekh
Copy link
Copy Markdown

Fixes / New Feature #

  • There's certain scenarios where Connection:Close is needed (i.e. disabling persistent http connections). This PR let's us be able to configure ConnectionClose: true|false under GlobalConfiguration or per Route in the Ocelot configuration files.

Proposed Changes

  • If ConnectionClose is set to true in configuration, add the Connection header with value Close to indicate to the server to not keep the connection open

Side note: When benchmarking this on Azure Kubernetes Service (AKS), we observed that we got a higher throughput when running with Connnection:Close than using the Ocelot.Provider.Kubernetes package (which queries the Kubernetes API prior to sending each request). This is one scenario where this PR is beneficial.

@bjartekh
Copy link
Copy Markdown
Author

Build failed, probably fixed by #1436 ?

stefancruz added a commit to stefancruz/Ocelot that referenced this pull request Dec 22, 2022
Conflicts:
	src/Ocelot/Requester/HttpClientBuilder.cs

Cherry picked from ThreeMammals#1441
@raman-m
Copy link
Copy Markdown
Member

raman-m commented Jun 30, 2023

Please do the following:

  • Merge PR 1
  • Rebase feature branch onto develop
  • Resolve all merge conflicts

@raman-m raman-m added the conflicts Feature branch has merge conflicts label Jul 11, 2023
@raman-m raman-m force-pushed the feature/connection-close-opt-in branch from d562ced to 05d0c97 Compare August 23, 2023 17:44
@raman-m raman-m added feature A new feature needs feedback Issue is waiting on feedback before acceptance and removed conflicts Feature branch has merge conflicts labels Aug 23, 2023
@raman-m
Copy link
Copy Markdown
Member

raman-m commented Aug 23, 2023

@bjartekh Hi Bjarte!
I thought you needed some help to resolve conflicts. 😉
The feature branch has been rebased onto ThreeMammals:develop successfully!
Welcome to code review!
Good luck!


I see that develop branch in your fork is too old.
Could you Sync fork please? So, the develop branch will be updated with all top commits!
Could you add me as collaborator to your forked repo please? I will update develop branch.


Is this PR related to an issue in backlog?

@raman-m raman-m added the 2023 Annual 2023 release label Mar 5, 2024
@raman-m raman-m added this to the Annual 2023 milestone Mar 5, 2024
@raman-m raman-m changed the base branch from develop to release/24.0 March 5, 2024 10:04
@raman-m raman-m force-pushed the feature/connection-close-opt-in branch from 05d0c97 to b0b7f66 Compare April 7, 2024 12:27
Comment thread src/Ocelot/Requester/HttpClientBuilder.cs Outdated
@raman-m raman-m force-pushed the feature/connection-close-opt-in branch from b0b7f66 to 00469fc Compare April 16, 2024 16:52
@raman-m raman-m removed the request for review from binarymash April 16, 2024 16:57
@raman-m raman-m added this to the Autumn'24 milestone Oct 26, 2024
@raman-m raman-m force-pushed the feature/connection-close-opt-in branch from 2ec9ff1 to b0879ea Compare November 5, 2024 10:04
@raman-m
Copy link
Copy Markdown
Member

raman-m commented Nov 5, 2024

@bjartekh, are you available? Could you please continue working on your pull request?

@raman-m raman-m requested a review from ggnaegi November 5, 2024 10:14
@raman-m raman-m force-pushed the develop branch 14 times, most recently from c216cdf to b458f0f Compare April 7, 2025 16:13
@raman-m raman-m force-pushed the develop branch 6 times, most recently from 1544d9b to 4bd354b Compare April 15, 2025 14:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Configuration Ocelot feature: Configuration feature A new feature Spring'26 Spring 2026 release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants