Skip to content

fix: [stable-9.0][OCISDEV-1724] reuse HTTP connections in the proxy - #13542

Merged
2403905 merged 2 commits into
stable-9.0from
fix/9.0/OCISDEV-1724
Nov 20, 2026
Merged

2403905 merged 2 commits into
stable-9.0from
fix/9.0/OCISDEV-1724

Conversation

@2403905

@2403905 2403905 commented Nov 20, 2026

Copy link
Copy Markdown
Contributor

Backport of #13539 to stable-9.0.

Problem

Under high load (k6 mixed test, 300 VUs), the proxy opens a new connection for most requests. The host runs out of ports. This causes failed logins and failed requests.

Ticket: OCISDEV-1724. The load test numbers and the analysis are in the ticket.

Change

  1. services/proxy/pkg/proxy/proxy.go: 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. services/proxy/pkg/command/server.go: the OIDC client keeps its connections alive. Before, it used DisableKeepAlives: true.
  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. go.mod: bump reva to the commit of fix: [stable-9.0][OCISDEV-1724] reuse HTTP connections in the reva clients reva#826. This PR has the same fix for the reva HTTP clients.

Difference from #13539

  • On stable-9.0, the OIDC client sets Proxy: http.ProxyFromEnvironment. The new function newOIDCHTTPClient in services/proxy/pkg/command/server.go keeps it.
  • On stable-9.0, the proxy wraps its transport in autoprop.NewHttpRoundTripper. services/proxy/pkg/proxy/proxy.go keeps this wrapper.
  • The vendor tree of stable-9.0 has a local patch in vendor/github.com/owncloud/reva/v2/pkg/storage/utils/decomposedfs/metadata/ (ErrAttrUnset). Reva stable-9.0 does not have this patch. go mod vendor removes it, so I restored these files. The patch stays unchanged.

Reva bump

The bump also brings these reva commits:

Tests

  • I ran go test -race for ./services/proxy/.... All tests pass.
  • I built ./ocis/cmd/ocis with -mod=vendor.
  • I did not run a load test with this version.

Before merge

This PR is a draft. go.mod points to the commit of the open reva PR owncloud/reva#826. After that PR is merged, bump reva again to the merge commit.

🤖 Generated with Claude Code

@kw-security

kw-security commented Nov 20, 2026 •

Copy link
Copy Markdown

✅ Snyk checks have passed. No issues have been found so far.

Status Scan Engine Critical High Medium Low Total (0)
✅ Open Source Security 0 0 0 0 0 issues
✅ Licenses 0 0 0 0 0 issues
✅ Code Security 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

@2403905
2403905 marked this pull request as ready for review November 20, 2026 14:49
@2403905
2403905 requested a review from a team as a code owner November 20, 2026 14:49
2403905 and others added 2 commits November 20, 2026 15:50
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#826).

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]>
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]>
@2403905
2403905 force-pushed the fix/9.0/OCISDEV-1724 branch from dde1acc to e8ed124 Compare November 20, 2026 14:53
@2403905
2403905 enabled auto-merge (squash) November 20, 2026 14:55
@2403905
2403905 merged commit b89661b into stable-9.0 Nov 20, 2026
83 checks passed
@2403905
2403905 deleted the fix/9.0/OCISDEV-1724 branch November 20, 2026 15:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants