Delay pipe attachment for builder-invoked responses to prevent race condition#2571
Delay pipe attachment for builder-invoked responses to prevent race condition#2571SanojPunchihewa wants to merge 1 commit into
Conversation
…ondition When multiple chunks are received by the TargetHandler, the target response may read from the pipe and mark consumer output as active. This can trigger the SourceResponse to start writing the response while the worker thread is still executing setContentType() and adding response headers.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughChanges SummaryThis PR addresses a race condition in HTTP response handling by deferring pipe attachment for builder-invoked responses. What ChangedIn the
Root CauseWhen chunked responses arrive at the backend, subsequent chunks can trigger Impact
WalkthroughIn 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Purpose
Delay pipe attachment for builder-invoked responses to prevent race condition
When multiple chunks are received by the TargetHandler, the target response may read from the pipe and mark consumer output as active. This can trigger the SourceResponse to start writing the response while the worker thread is still executing setContentType() and adding response headers.
Fixes: wso2/product-integrator-mi#4938