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

[pkg/stanza] Delete after read deletes partially read files #18926

Closed
cpheps opened this issue Feb 27, 2023 · 2 comments · Fixed by #19138
Closed

[pkg/stanza] Delete after read deletes partially read files #18926

cpheps opened this issue Feb 27, 2023 · 2 comments · Fixed by #19138
Assignees
Labels
bug Something isn't working needs triage New item requiring triage pkg/stanza

Comments

@cpheps
Copy link
Contributor

cpheps commented Feb 27, 2023

Component(s)

pkg/stanza

What happened?

Description

When the collector is shutdown while still in progress reading a file it will delete the file even though it's not fully been read.

Steps to Reproduce

Setup the filelog receiver with delete_after_read enabled and target a large file. Start the collector then immediately stop it. The file will be deleted even though the collector didn't finish reading it.

Expected Result

File is left intact until fully read.

Actual Result

File is deleted on shutdown when only partially read.

Collector version

v0.71.0

Environment information

Environment

OS: macOS 13.2.1
Compiler(if manually compiled): go 1.20.1

OpenTelemetry Collector configuration

receivers:
  filelog:
    include: ["/tmp/logs/*.log"]
    start_at: beginning
    delete_after_read: true
exporters:
  logging:

service:
  pipelines:
    logs:
      receivers: [filelog]
      exporters: [logging]

Log output

No response

Additional context

No response

@cpheps cpheps added bug Something isn't working needs triage New item requiring triage labels Feb 27, 2023
@cpheps
Copy link
Contributor Author

cpheps commented Feb 27, 2023

I'll volunteer to work on this.

@github-actions
Copy link
Contributor

Pinging code owners:

See Adding Labels via Comments if you do not have permissions to add labels yourself.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working needs triage New item requiring triage pkg/stanza
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant