Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@blp
Copy link
Member

@blp blp commented Jan 23, 2026

Thanks to Bruno Rucy @brurucy and Abhinav Gyawali @abhizer for help with this issue.

Fixes: #3495

Thanks to Bruno Rucy @brurucy and Abhinav Gyawali @abhizer for help with
this issue.

Fixes: #3495
Signed-off-by: Ben Pfaff <[email protected]>
@blp blp requested a review from abhizer January 23, 2026 00:49
@blp blp self-assigned this Jan 23, 2026
@blp blp added bug Something isn't working connectors Issues related to the adapters/connectors crate labels Jan 23, 2026
Copilot AI review requested due to automatic review settings January 23, 2026 00:49
@blp blp added the rust Pull requests that update Rust code label Jan 23, 2026
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes a data interleaving issue in the HTTP ingress connector by moving the StreamSplitter from shared endpoint state to per-request local scope.

Changes:

  • Removed StreamSplitter from HttpInputEndpointDetails struct to prevent concurrent requests from sharing state
  • Refactored the push method to accept parsed chunks directly instead of managing splitting logic
  • Created a new StreamSplitter instance within the request handling loop to ensure each request has its own isolated splitter

Comment on lines +283 to +285
while let Some(chunk) = splitter.next(eoi) {
num_errors += self.push(chunk, &mut errors, timestamp);
}
Copy link

Copilot AI Jan 23, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The timestamp variable is captured once before the loop but reused for all chunks. If the splitter produces multiple chunks, they will all receive the same timestamp even though they may be processed at slightly different times. Consider capturing a fresh timestamp inside the loop for each chunk to ensure accurate temporal ordering of events.

Copilot uses AI. Check for mistakes.
}
Ok(None) => true,
};
while let Some(chunk) = splitter.next(eoi) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so the fix is because this loop cannot be interrupted?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's more than that. Each call to complete_request receives a payload, which gets read read chunk by chunk. If the request is short, there's only one chunk total, and if that chunk ends in a new-line (which is what the splitter looks for in the case of JSON with default settings), then push will split it properly. But if the request is long, and the chunks do not end in new-lines (they only would by luck), then push will feed in all the full records in the current chunk and leave the start of the next record in its buffer. Then, the next chunk from any request will be appended. Obviously, the start of one record followed by part of another record from a different source will cause something bad to happen, and that's what was happening.

By making each request break its input data into full records, and then only passing the full records to the parser, we avoid the problem.

@brurucy
Copy link

brurucy commented Jan 23, 2026

I will test this as soon as it is merged. In my use-case I routinely see tens of parsing failures every day

@mihaibudiu
Copy link
Contributor

It's easy to overlook an issue if it's not solved quickly, please ping us again if you have bugs like this one so we can assign them higher priority.

@blp blp added this pull request to the merge queue Jan 23, 2026
Merged via the queue into main with commit 94a1805 Jan 23, 2026
6 of 7 checks passed
@blp blp deleted the issue3495 branch January 23, 2026 06:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working connectors Issues related to the adapters/connectors crate rust Pull requests that update Rust code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[http ingress]: JSON parse errors when bombarded with HTTP POST requests to insert data to the table

4 participants