-
Estimate
2 developer-days (7–12.5h)
Task Estimate Grep + audit all WebClientcall sites in the Sztabina client layer, categorize by risk1–2h Streaming refactor for blob fetch (highest risk — pipe to ServerHttpResponse)2–3h Streaming refactor for diff / patch fetch 1–2h Streaming refactor for tree listing (verify or clear) 0.5–1h Any pack / clone proxying if present 1–2h Remove maxInMemorySizeoverride, smoke test locally0.5h Regression pass (large blob + large diff) 1–2h Main wildcard: call sites that feed into a non-trivial processing pipeline between receipt and response. Pure pass-through is straightforward; any parsing or transformation in the middle makes the streaming refactor more involved.
-
-
-
Related fixes: https://tigase.dev/sztab/~issues/120
Current flow:
Sztabina computes diff => writes entire response to HTTP body Sztab WebClient receives => buffers entire body in JVM heap => processesFor a 50MB diff that means 50MB sits in heap before Sztab can do anything with it. Spring WebFlux enforces a 16MB limit on that buffer - anything larger throws DataBufferLimitException.
With streaming:
Sztabina computes diff => writes chunks as they're ready Sztab WebClient receives chunks => processes each chunk => forwards to browserMemory stays flat: at any moment only one chunk is in flight, not the whole payload.
-
-
The primary goal is achieved:
-
DataBufferLimitException eliminated -
Pagination implemented and validated against LLVM -
Follow-on (SZ-155) created and deferred
rksuma@Ramakrishnans-MacBook-Pro sztab % git branch -d feature/sz-125-streaming Deleted branch feature/sz-125-streaming (was c2aa07b). rksuma@Ramakrishnans-MacBook-Pro sztab % git push origin --delete feature/sz-125-streaming remote: remote: Create a pull request for 'feature/sz-125-streaming' by visiting: remote: https://tigase.dev/sztab/~pulls/new?target=1325:wolnosc&source=1325:feature/sz-125-streaming remote: To https://tigase.dev/sztab.git - [deleted] feature/sz-125-streaming rksuma@Ramakrishnans-MacBook-Pro sztab % git fetch --prune rksuma@Ramakrishnans-MacBook-Pro sztab % rksuma@Ramakrishnans-MacBook-Pro sztab % git branch git branch -r backup-SZ-Error-Handling-UX-stash backup/SZ44-chaos bugfix/sz-32-backend-fixes experiment/git-compare feature/Issue-DSL-Query-Engine feature/SZ-48-gitrepo-insane-changes feature/first-rev-community-user * wolnosc origin/HEAD -> origin/wolnosc origin/backup/SZ44-chaos origin/bugfix/SZ-77-repoType-inference origin/bugfix/issue-17 origin/bugfix/logout-redirect origin/bugfix/sz-32-backend-fixes origin/bugfix/sz23-improve-domain-model origin/bugfix/sz23-improve-domain-model-new origin/documentation/sz18 origin/experiment/git-compare origin/feature/SZ-105-Default-Issue-Assignee origin/feature/SZ-48-Branch-Management-UI origin/feature/SZ-48-gitrepo-insane-changes origin/feature/SZ-50-Issue-Management-UI origin/feature/SZ-73-git-bot-mitigation origin/feature/SZ-94-sztabctl origin/feature/commit-discovery-pr-creation origin/feature/first-rev-community-user origin/feature/jpa-spec-queries origin/feature/lambda-refactor-userservice origin/feature/repo-browser-jgit origin/feature/sz-14-authz-rbac-static origin/feature/sz-26-web-ui-scaffolding origin/feature/sz-39-admin-user-management origin/feature/sz-4-spring-security-authn-authz origin/improvement/sz26-sztab-backend-for-web-ui origin/master origin/task/oci-staging-k3s-staging-cluster origin/wolnosc rksuma@Ramakrishnans-MacBook-Pro sztab % -
| Type |
Bug
|
| Priority |
Normal
|
| Assignee | |
| Version |
1.10.1
|
| Sprints |
n/a
|
| Customer |
n/a
|
Issue Votes (0)
Screenshot 2026-04-27 at 6.08.11 PM
Labels:
enhancementreliabilitybackendsztabina-integrationPriority: High Milestone: MVP (blocker)Background
During testing, Sztab crashed with a non-obvious exception originating in the Netty/WebFlux codec layer (see: https://tigase.dev/sztab/~issues/119). Root cause: the Sztab
WebClient(consumer) was collecting the full Sztabina (producer) HTTP response body into an in-memory buffer before processing it. For large git payloads — blobs, diffs, pack data, or tree listings — this buffer overflowed the WebFlux default codec limit.Sztabina had no visibility into the overflow; it served the response normally. The failure manifested entirely on the Sztab side as a cryptic
DataBufferLimitExceptionor similar Reactor Netty codec error, with no indication in the stack trace that response size was the actual cause. This class of failure is silent until it isn't — it will recur on any sufficiently large repository in production.Tentative Fix (currently in place)
The
WebClientcodec configuration was patched with an approximate max-in-memory size ceiling:This is a stopgap. It is brittle because:
Desired Solution
Replace the collect-to-body pattern with proper reactive streaming wherever Sztab consumes Sztabina responses.
Before (buffered — current stopgap):
After (streaming):
For endpoints that serve content directly to the browser (e.g. blob download), the preferred pattern is to pipe the
Flux<DataBuffer>directly into the SpringServerHttpResponsewithout ever collecting:This keeps memory flat regardless of payload size.
Scope — Full Audit Required
Since the affected scope is not fully characterized, all Sztab service classes that call Sztabina via
WebClientmust be audited. Suspected or confirmed affected interactions:bodyToMono(byte[].class)orbodyToMono(String.class)A grep for
bodyToMonoandbodyToFluxin the Sztabina client layer is the recommended starting point for the audit.Acceptance Criteria
WebClientcalls to Sztabina that carry potentially large payloads usebodyToFlux(DataBuffer.class)or equivalent streaming extraction — nobodyToMono(byte[].class)orbodyToMono(String.class)on unbounded responses.DataBufferUtils.release()is called on every consumedDataBufferto prevent Netty off-heap memory leaks.maxInMemorySizeoverride is removed or reduced back to the WebFlux default once streaming is fully in place.DataBufferLimitExceptionor observable heap spike.DataBufferLimitExceptionappears in logs under normal repo browsing.