Skip to content

out_bigquery: make HTTP buffer size configurable #10596

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

tsubaron
Copy link

@tsubaron tsubaron commented Jul 15, 2025

Replace hardcoded HTTP buffer size in the BigQuery output plugin with a configurable value from ctx->buffer_size.

Previously, the buffer size was fixed at 4192 bytes:

flb_http_buffer_size(c, 4192);

This has now been updated to:

flb_http_buffer_size(c, ctx->buffer_size);

so that users can adjust the buffer size via configuration if needed.

We understand that the buffer size was previously hardcoded because BigQuery API responses are generally assumed to be of fixed size.

However, in practice we have observed cases where the plugin encounters buffer overflow errors. We suspect this happens when the BigQuery API returns larger-than-expected error responses in certain situations.

Making the buffer size configurable allows users to increase it as needed to inspect the full API response, which is especially useful for debugging and monitoring unexpected behaviors in production environments.

This is a small, backward-compatible change that does not alter existing behavior unless the buffer_size option is explicitly configured. The default value remains 4192 bytes. For these reasons, we believe this enhancement is suitable for inclusion in the next patch release (4.0.x).

Fixes #9061


Enter [N/A] in the box, if an item is not applicable to your change.

Testing
Before we can approve your change; please submit the following in a comment:

  • Example configuration file for the change
[SERVICE]
    flush        1
    daemon       off
    log_level    debug

[INPUT]
    name         dummy
    dummy        {"message":"Hello BigQuery"}

[OUTPUT]
    name                       bigquery
    match                      *
    project_id                 your_gcp_project_id
    dataset_id                 your_dataset_id
    table_id                   your_table_id
    google_service_credentials /path/to/service_account.json
    buffer_size                8192
  • Debug log output from testing the change
スクリーンショット 2025-07-15 16 01 03
  • Attached Valgrind output that shows no leaks or memory corruption was found
    [N/A] This change only adjusts the buffer size configuration; no memory allocations or changes in lifecycle management were introduced.

If this is a change to packaging of containers or native binaries then please confirm it works for all targets.

  • Run local packaging test showing all targets (including any new ones) build.
    [N/A]
  • Set ok-package-test label to test for all targets (requires maintainer to do).
    [N/A]

Documentation

  • Documentation required for this feature

See: fluent/fluent-bit-docs#1915

Backporting

  • Backport to latest stable release.
    This enhancement is backward-compatible and small in scope. We believe it is suitable for inclusion in the next patch release (4.0.x).

Fluent Bit is licensed under Apache 2.0, by submitting this pull request I understand that this code will be released under the terms of that license.

Signed-off-by: Tsubasa Miyamoto <tsubasa.miyamoto@gmail.com>
@tsubaron tsubaron force-pushed the out_bigquery-buffer-size-configurable branch from 3ab7b10 to 44deb46 Compare July 18, 2025 09:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bigquery Output Plugin HTTP buffer size is not configurable.
1 participant