gnodet opened a new pull request, #2957:
URL: https://github.com/apache/cxf/pull/2957

   ## Summary
   Fixes [CXF-8096](https://issues.apache.org/jira/browse/CXF-8096) — 
`LoggingFeature` blocks client reads on streaming responses.
   
   **Root cause:** `WireTapIn` interceptor eagerly reads the entire input 
stream via `IOUtils.copyAtLeast()` before the application can process it. For 
streaming responses (e.g., `StreamingOutput` with chunked transfer), this 
blocks the client from reading data incrementally.
   
   **Fix:**
   - Introduces `TeeInputStream` — wraps the input stream and copies data to 
the logging cache as it flows through (up to the configured limit), without 
blocking
   - `WireTapIn` now uses `TeeInputStream` instead of the eager `copyAtLeast` + 
`SequenceInputStream` approach
   - `LoggingInInterceptor` defers logging to a stream-close callback when the 
stream hasn't been consumed yet (streaming case), while preserving immediate 
logging for cases where the body is already consumed (e.g., SOAP/JAX-WS where 
unmarshal happens before PRE_INVOKE)
   
   **Key files:**
   - `TeeInputStream.java` — new class, copies reads to `CachedOutputStream` 
transparently
   - `WireTapIn.java` — uses `TeeInputStream` instead of eager read
   - `LoggingInInterceptor.java` — deferred logging via close callback
   - Test updates to consume streams before asserting log events (reflecting 
the new non-blocking behavior)
   - New `streamingInputShouldNotBlockRead` test verifying the streaming 
scenario
   
   Supersedes #574 (which was test-only with no fix).
   
   ## Test plan
   - [x] All existing logging module tests pass (124 tests)
   - [x] New streaming test (`streamingInputShouldNotBlockRead`) verifies 
non-blocking behavior
   - [ ] CI pipeline
   
   🤖 Generated with [Claude Code](https://claude.com/claude-code)


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to