bryancall opened a new pull request, #12760:
URL: https://github.com/apache/trafficserver/pull/12760

   The xdebug probe-full-json transform was calling `TSContCall(WRITE_READY)` 
even when no data was available to consume (`towrite == 0`). This caused 
unnecessary callbacks to the transform, and under certain conditions could lead 
to a tight loop that would starve other transactions on the same ET_NET thread.
   
   ## The Bug
   
   When using `X-Debug: probe-full-json=nobody` (or other probe-full-json 
variants), if the origin server was slow to send body data, the transform would:
   1. Be called with `WRITE_READY` event
   2. See no data available (`towrite == 0`)
   3. Still call `TSVIOReenable` and `TSContCall(WRITE_READY)` back to upstream
   4. Get called again immediately (step 1)
   
   This creates a tight loop that can cause:
   - High CPU usage on the affected ET_NET thread
   - Starvation of other transactions on the same thread
   - Requests appearing to "hang"
   
   ## The Fix
   
   Add a check to only call `TSVIOReenable` and `TSContCall` when `towrite > 
0`, meaning we actually consumed data. If no data was available, we simply 
return and wait for the upstream to call us again when more data arrives.
   
   ## Testing
   
   Added a new autest (`x_probe_full_json_slow_origin`) that uses a slow origin 
server with chunked encoding to verify the transform handles delayed body data 
correctly.


-- 
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