Skip to content

connectors: http_source accepts a body Iggy cannot store, then stalls #4301

Description

@mlevkov

What happens

http_source answers 200 to two kinds of body that Iggy refuses to store:

  • An empty body. IggyMessage::new refuses it with InvalidMessagePayloadLength.
  • A body over MAX_PAYLOAD_SIZE (64,000,000 bytes). max_body_size_bytes accepts values up to MAX_BODY_SIZE_BYTES_LIMIT (67,108,864), so a config above 64,000,000 lets these through. IggyMessage::new refuses them with TooBigMessagePayload.

The runtime cannot build that message, so it sends nothing from the batch and NACKs it. http_source keeps the batch and replays it first on every poll, so the batch can never succeed.

Why it matters

On master, five NACKs stop the poll task. The listener keeps answering 200 until the bridge fills, and the restart that recovers the connector drops everything in the bridge. With #4269, which turns the NACK limit off for http_source, the batch replays forever instead, and /health stays 200.

One empty POST that passes authentication is enough, with default limits. The on_nack doc says the connector refuses bad input at the door. For these two cases it does not.

Fix

  • enqueue answers 400 {"error":"empty body"} for an empty body, before anything is queued.
  • MAX_BODY_SIZE_BYTES_LIMIT becomes MAX_PAYLOAD_SIZE, so every body the handlers accept can be stored, and an oversize body gets the existing 413. A config with max_body_size_bytes above 64,000,000 now fails open(). Such a config can already stall the source.
  • Correct the on_nack doc and the README tables to match.

Provenance

Found while reviewing #4269: #4269 (comment). The code came in with #3798.

Contribution

  • I'm willing to submit a pull request to fix this bug
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingconnectorsConnectors runtime

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions