Repository navigation
fix: [OCISDEV-1724] reuse HTTP connections in the reva clients - #825
Merged
Merged
Conversation
Under high load, the HTTP clients of reva opened a new connection for most requests. The default transport of Go keeps 2 idle connections for each host. The extra connections close after each request. The host runs out of ports. 1. The metadata client uses its own transport. All CS3 instances share it. 2. The function GetHTTPClient keeps up to 100 idle connections for each host. The ocdav service and the data gateway use this function. 3. Both clients close an idle connection after 30 seconds. A load balancer or an ingress controller often closes an idle connection after 60 seconds. The client must close first. The transport does not repeat a PUT or POST request on a connection that the other side closed. On this branch, GetHTTPClient wraps the transport in an autoprop round tripper. The new function newTransport builds the base transport, so that the test can check its settings. Tests send two bursts of parallel requests. The second burst reuses the idle connections of the first burst. Backport of #824 (cherry picked from commit af7eb0a). Co-Authored-By: Claude Sonnet 5.5 <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]>
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
LarsJurgensen
approved these changes
Nov 20, 2026
LukasHirt
approved these changes
Nov 20, 2026
2403905
added a commit
to owncloud/ocis
that referenced
this pull request
Nov 20, 2026
Under high load, the proxy opened a new connection for most requests. The host ran out of ports. This caused failed logins and failed requests. 1. The backend transport keeps up to 100 idle connections for each backend. Before, it kept 2. It has no global limit for idle connections. 2. The OIDC client keeps its connections alive. Before, it opened a new connection with a new TLS handshake for each call. 3. Both close an idle connection after 30 seconds. Before, the proxy used 90 seconds. A load balancer or an ingress controller often closes an idle connection after 60 seconds. The proxy must close first. 4. Bump reva to get the same fix for the reva HTTP clients (owncloud/reva#825). Tests send two bursts of parallel requests. The second burst reuses the idle connections of the first burst. Backport of #13539. Co-Authored-By: Claude Sonnet 5.5 <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Roman Perekhod <[email protected]>
2403905
added a commit
to owncloud/ocis
that referenced
this pull request
Nov 20, 2026
* fix: [OCISDEV-1724] reuse HTTP connections in the proxy Under high load, the proxy opened a new connection for most requests. The host ran out of ports. This caused failed logins and failed requests. 1. The backend transport keeps up to 100 idle connections for each backend. Before, it kept 2. It has no global limit for idle connections. 2. The OIDC client keeps its connections alive. Before, it opened a new connection with a new TLS handshake for each call. 3. Both close an idle connection after 30 seconds. Before, the proxy used 90 seconds. A load balancer or an ingress controller often closes an idle connection after 60 seconds. The proxy must close first. 4. Bump reva to get the same fix for the reva HTTP clients (owncloud/reva#825). Tests send two bursts of parallel requests. The second burst reuses the idle connections of the first burst. Backport of #13539. Co-Authored-By: Claude Sonnet 5.5 <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Roman Perekhod <[email protected]> * fix: [OCISDEV-1724] bump reva to the merge commit Reva merged the fix for the HTTP clients. Point go.mod to the merge commit. Co-Authored-By: Claude Sonnet 5.5 <[email protected]> Signed-off-by: Roman Perekhod <[email protected]> --------- Signed-off-by: Roman Perekhod <[email protected]> Co-authored-by: Claude Sonnet 5.5 <[email protected]>
1 task done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Backport of #824 to
main.Problem
Under high load, the HTTP clients of reva open a new connection for most requests. The default transport of Go keeps 2 idle connections for each host. The extra connections close after each request. The host runs out of ports. This causes failed requests.
Ticket: OCISDEV-1724. The load test numbers and the analysis are in the ticket.
Change
pkg/storage/utils/metadata/cs3.go: the metadata client uses its own transport. AllCS3instances share it. It keeps up to 100 idle connections for each host.pkg/rhttp/client.go:GetHTTPClientkeeps up to 100 idle connections for each host. Theocdavservice and the data gateway use this function.Difference from #824
On
main,GetHTTPClientwraps the transport inautoprop.NewHttpRoundTripper. The test of #824 cannot get the*http.Transportthrough this wrapper. The new functionnewTransportinpkg/rhttp/client.gobuilds the base transport. The test checks the settings of this transport. The behavior ofGetHTTPClientdoes not change.Tests
go test -racefor./pkg/rhttp/and./pkg/storage/utils/metadata/. All tests pass.TestGetHTTPClientReusesConnectionsfails. The test checks the full client with theautopropwrapper.Next step
After this PR is merged, the oCIS
go.modonmasterneeds a bump.🤖 Generated with Claude Code