mlevkov opened a new issue, #4301:
URL: https://github.com/apache/iggy/issues/4301

   ## 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: 
https://github.com/apache/iggy/pull/4269#discussion_r4109574429. The code came 
in with #3798.
   
   ### Contribution
   
   - [x] I'm willing to submit a pull request to fix this bug
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to