mirror of
https://github.com/openobserve/openobserve.git
synced 2026-11-04 16:09:05 +00:00
## Problem CI job **Pipelines-Regression** consistently fails on: > `[chromium] › pipeline-regression.spec.js:73 › should validate scheduled pipeline SQL query with metrics stream type` with `FetchError: Invalid response body … Premature close` on every attempt. PR #12793 added `fetchWithRetry` to handle transient network errors, but the underlying cause — **node-fetch v2 keep-alive pooling + gzip decompression** — can survive retries when every connection attempt picks up the same dead socket from the pool. ## Root cause `node-fetch` v2 defaults: - `compress: true` → sends `Accept-Encoding: gzip` and pipes response through `Gunzip` - Implicit HTTP agent with `keepAlive: true` → reuses connections across requests When the server closes a pooled connection before the response body is fully read, `Gunzip` throws "Premature close." Because the bad connection stays in the pool, retries can hit the same socket and fail identically. ## Fix - Use `keepAlive: false` agent → every fetch gets a fresh connection - Set `compress: false` → bypass the `Gunzip` stream where the error originates - Keep the retry wrapper as a safety net for any remaining transient faults ## Test plan - [ ] CI: `Pipelines-Regression` job passes (especially the metrics stream type test) - [ ] Full `pipeline-regression.spec.js` suite passes locally 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>