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

Idle timeout and terminate for stdin source #1195

Closed
sgowie opened this issue Nov 15, 2019 · 3 comments
Closed

Idle timeout and terminate for stdin source #1195

sgowie opened this issue Nov 15, 2019 · 3 comments
Labels
source: stdin Anything `stdin` source related type: bug A code related bug. type: help User support and help.

Comments

@sgowie
Copy link

sgowie commented Nov 15, 2019

I found myself relying on the timeout command to prompt Vector into shutting down when used to read from stdin in parallel (about 7000 invocations).

e.g.

find . -type f -name "*.log.gz" | xargs -P 12 -I % sh -c 'zcat % | timeout 15 vector --config /etc/vector/ingest.toml'

The ingest.toml would read from stdin and perform a small set of transforms before sinking to another vector instance where some metrics were extracted. I opted for this model since vector doesn't perform decompression for file type sources. Unfortunately Vector will remain open preventing the xargs loop from proceeding. Using timeout here isn't something I'm necessarily comfortable with, but it did effectively allow me to process nearly 2 years of event logs.

If the stdin source could be configured to trigger the shutdown of vector after some defined idle period (ensuring any batched sinks are flushed), processing historical logs can be done without foreknowledge relating to the processing time per file that vector would presumably take.

@binarylogic
Copy link
Contributor

Hi @sgowie, thanks for reporting. Which version of Vector are you using? I ask because we fixed a related issue where the stdin source would fail to shutdown in #960. Let me know if that resolves your issue. We'll be getting a new release out this week.

@binarylogic binarylogic added source: stdin Anything `stdin` source related type: bug A code related bug. type: help User support and help. labels Nov 17, 2019
@sgowie
Copy link
Author

sgowie commented Nov 19, 2019

We were using version 0.5.0:
timberio/vector 0.5.0-alpine b4eecb762b28 5 weeks ago 24.5 MB

From what I can tell this is the same version that's available in the nightly build, but was built prior to that pull being merged.

@binarylogic
Copy link
Contributor

Thanks @sgowie. I've confirmed this has been resolved. Please let us know if you continue to experience this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
source: stdin Anything `stdin` source related type: bug A code related bug. type: help User support and help.
Projects
None yet
Development

No branches or pull requests

3 participants