ACM-35599 Fix MCE pod log errors#6354
Conversation
Signed-off-by: fxiang1 <fxiang@redhat.com>
📝 WalkthroughWalkthroughTwo defensive fixes in the backend: ChangesHTTP Response Double-Write Guards
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes 🚥 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 |
|
|
@fxiang1 Looks good. Can you patch this onto |
|
@KevinFCormier Yep, I patched console-mce earlier on the weekly and it looks good. I just realized I need to patch the console pods as well. Patching those now. You can take a look at the console-mce pods. |
|
/lgtm |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: fxiang1, KevinFCormier The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
@KevinFCormier should we backport this fix all the way to ACM 2.13? |
Let's start with 2.17 and 2.16 for now. |
|
/cherrypick release-2.17 |
|
/cherrypick release-2.16 |
|
@fxiang1: new pull request created: #6355 DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
|
@fxiang1: new pull request created: #6356 DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |



📝 Summary
Ticket Summary (Title):
ACM Console pods are continuously logging ERR_STREAM_UNABLE_TO_PIPE and ERR_HTTP_HEADERS_SENT errors
Ticket Link:
https://redhat.atlassian.net/browse/ACM-35599
Type of Change:
✅ Checklist
General
ACM-12340 Fix bug with...)If Feature
If Bugfix
🗒️ Notes for Reviewers
Root Cause
When a browser sends a conditional request with If-Modified-Since matching the file's modification time, the code correctly sends a 304 Not Modified and ends the response — but then falls through into the compression/streaming code below (lines 86–152).
The Error Chain
Here's exactly what happens:
All three errors in your log trace back to this single missing return.
Analysis for if this was caused by the Nodejs 24 upgrade
Why it was silent before: In Node.js 20/22, when pipeline() was called with an already-ended response stream, the behavior was more lenient — it would either silently fail or just call the error callback without throwing. The response data was effectively dropped, but no loud errors were produced. The 304 was correctly sent to the client, so functionally everything appeared to work.
What changed in Node.js 24: The streams implementation tightened up:
So the bug was always there — the 304 path was always falling through and attempting to pipe/write headers on a finished response — but older Node.js versions silently swallowed it. Node.js 24's stricter stream semantics turned it into the three visible errors you're seeing. The fix is correct regardless of Node.js version.
Summary by CodeRabbit