Skip to content

Conversation

@paulojmdias
Copy link
Member

@paulojmdias paulojmdias commented Oct 23, 2025

Description

When the log lines are written exactly with the first 1000 bytes equal, if a copytruncate happens, is there a possibility of stopping reading the file. This was discovered using the otlpjsonfile receiver and doing the copytruncate option on multiple services.

This PR resets the offsets if the current offset is higher than the file size, which usually happens when a copytruncate operation occurs.

Link to tracking issue

Fixes #43693

Testing

Added tests to simulate writing the same lines more than 1000 bytes multiple times, and validate copytruncate offsets reset.

…rotation

Signed-off-by: Paulo Dias <paulodias.gm@gmail.com>
@paulojmdias paulojmdias marked this pull request as ready for review October 23, 2025 21:00
@paulojmdias paulojmdias requested review from a team and andrzej-stencel as code owners October 23, 2025 21:00
Signed-off-by: Paulo Dias <paulodias.gm@gmail.com>
…ector-contrib into fix/43693

Signed-off-by: Paulo Dias <paulodias.gm@gmail.com>
Copy link
Member

@andrzej-stencel andrzej-stencel left a comment

Choose a reason for hiding this comment

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

I'm marking this as "Request changes", because I want to be sure we understand the consequences before merging this.

In principle, the fingerprint is the identifier of a file. The biggest issue I see here is that this seems to dismiss this principle in some cases.

I'll examine this pull request and your comments @paulojmdias on the corresponding issue in more detail. Thank you for digging into this! 🙏

@paulojmdias
Copy link
Member Author

Sure @andrzej-stencel! Please let me know of you need something.

Thanks for your review 🙏

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.

Collector stops reading new file after copytruncate rotation

2 participants