Skip to content

Fix GCS S3 upload client timeouts#1

Merged
solsson merged 2 commits into
mainfrom
fix-gcs-s3-upload-client-timeouts
Feb 17, 2026
Merged

Fix GCS S3 upload client timeouts#1
solsson merged 2 commits into
mainfrom
fix-gcs-s3-upload-client-timeouts

Conversation

@solsson
Copy link
Copy Markdown
Contributor

@solsson solsson commented Feb 17, 2026

Symptoms (observed with debug build)

Only the first write to GCS using the S3 client produces a blob. Every S3-to-GCS PutObject hangs for net.io_timeout seconds then fails:

  • [error] [http_client] broken connection to storage.googleapis.com:443
  • [error] [output:s3:s3.0] PutObject request failed

Root cause: GCS responds with x-goog-stored-content-length before
Content-Length: 0. fluentbit's strcasestr("Content-Length: ") matches
inside the longer header, reads the wrong value, and waits for a response
body that never arrives.

solsson and others added 2 commits February 17, 2026 08:09
…aries

GCS responses include x-goog-stored-content-length before Content-Length.
fluentbit's header_lookup() uses strcasestr("Content-Length: ") which
matches the substring inside x-goog-stored-content-length, reading the
stored object size instead of the response body length (typically 0).
This causes the HTTP client to wait for bytes that never arrive,
resulting in read timeouts and "broken connection" on every S3-to-GCS
upload.

The patch replaces the single strcasestr call with a loop that advances
past any match not preceded by \n (or at buffer start), so only actual
response header lines match. This is the minimal fix — no header
parsing rewrite — and stays correct for standard HTTP where each header
starts on its own line.

Build args FLB_TRACE and FLB_HTTP_CLIENT_DEBUG default to Off for
production; a separate debug-tagged image builds with both On.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@solsson solsson merged commit 0ff1bf0 into main Feb 17, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant