-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
[receiver/filelog] Fix bug in delete_after_read #31384
[receiver/filelog] Fix bug in delete_after_read #31384
Conversation
Thank you @djaglowski, #31384 does not panic anymore, however I feel something is still off When testing it on my local deployment, it raises an error for failing in seeking on the file which has been closed, and its Reader.file reference is still intact. This causes a lot of spurious logs for a behavior which is actually as per configuration. On a sidenote, the Warn log "finding files: no files match the configured criteria" also causes a lot of spam. The logs:
|
436571f
to
8220a70
Compare
Thanks @prigio. I've added another bit of handling so that we don't attempt to read "lost" files when we know they should have already been deleted. Looking into the problem, I think we may have an issue with detecting false positives when looking for "lost" files. However, I think this fix is enough to resolve your issue. I'll continue looking into the other issue separately. |
Thank you. I tried out your latest changes and it looks good now. |
Fixes open-telemetry#31383 This enhances `TestDeleteAfterRead` in a way that replicates the problem, and fixes the issue by retaining metadata on a reader until the exported `Close` function is called. Previously, we were removing the metadata when `delete` called `Close`, but this precluded the opportunity for the caller of `ReadToEnd` to properly manage file metadata after deletion.
Fixes open-telemetry#31383 This enhances `TestDeleteAfterRead` in a way that replicates the problem, and fixes the issue by retaining metadata on a reader until the exported `Close` function is called. Previously, we were removing the metadata when `delete` called `Close`, but this precluded the opportunity for the caller of `ReadToEnd` to properly manage file metadata after deletion.
Fixes #31383
This enhances
TestDeleteAfterRead
in a way that replicates the problem, and fixes the issue by retaining metadata on a reader until the exportedClose
function is called. Previously, we were removing the metadata whendelete
calledClose
, but this precluded the opportunity for the caller ofReadToEnd
to properly manage file metadata after deletion.