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

file input deletes empty files but doesn't actually process them #160

Open
ligfx opened this issue Jan 17, 2025 · 1 comment
Open

file input deletes empty files but doesn't actually process them #160

ligfx opened this issue Jan 17, 2025 · 1 comment
Labels
bug Something isn't working needs investigation It looks as though have all the information needed but investigation is required scanners Any tasks or issues relating specifically to scanners

Comments

@ligfx
Copy link

ligfx commented Jan 17, 2025

For instance, try echo -n > inputs/emptyfile vs echo > inputs/newlinefile. The empty file will send the message Consuming from file 'inputs/emptyfile' to the debug logger and will delete the file, but won't actually run any processors or outputs.

Example connect config:

logger:
  level: DEBUG

input:
  file:
    delete_on_finish: true
    paths:
    - inputs/*

pipeline:
  processors:
  - log:
      message: "This won't appear for empty files!"
@mihaitodor
Copy link
Collaborator

Hey @ligfx 👋 The log line you're seeing is a debug level message. While we could improve that, I think the current behaviour (deleting empty files and not producing any messages) is problematic. I'm leaning towards treating this as a special case and actually emitting a single message with no contents, but with the standard file metadata attached, so users can decide what action to take when such files are picked up.

PS: Moving this to the benthos repo, since that's where the file input is implemented.

@mihaitodor mihaitodor transferred this issue from redpanda-data/connect Jan 19, 2025
@mihaitodor mihaitodor added bug Something isn't working needs investigation It looks as though have all the information needed but investigation is required scanners Any tasks or issues relating specifically to scanners labels Jan 19, 2025
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 investigation It looks as though have all the information needed but investigation is required scanners Any tasks or issues relating specifically to scanners
Projects
None yet
Development

No branches or pull requests

2 participants