Skip to content
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

Add an option to respect filesystem locks to the filelog receiver. #34801

Merged

Conversation

sfc-gh-kstewart
Copy link
Contributor

Description: Add an option to respect filesystem locks to the filelog receiver.

When enabled otelcol will attempt to acquire a shared lock on files before reading them. If it is unable to acquire that lock it will ignore the file until the next poll cycle.

This feature is only implemented for Unix - on other platforms it is a no-op.

Link to tracking Issue: None

Testing: Manual testing was done on a laptop running macOS Sonoma 14.6.1. I verified that otelcol will not read a file that is actively locked by another process, and that it will proceed with reading once the lock is released.

Documentation: Added documentation for the filelog receiver describing this option.

We rely on sys/x/unix for the locking, which will not compile on non-Unix targets.  For non-Unix the locking code is just a no-op.
Copy link

linux-foundation-easycla bot commented Aug 21, 2024

CLA Signed

The committers listed above are authorized under a signed CLA.

@djaglowski djaglowski merged commit af9dcb3 into open-telemetry:main Aug 22, 2024
156 checks passed
@github-actions github-actions bot added this to the next release milestone Aug 22, 2024
@sfc-gh-kstewart sfc-gh-kstewart deleted the filelog-receiver-fs-lock branch August 22, 2024 15:44
f7o pushed a commit to f7o/opentelemetry-collector-contrib that referenced this pull request Sep 12, 2024
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.

3 participants