-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Wire ShutdownSignal into all sources #2108
Comments
Noting, this is somewhat related to the new futures work: #1142. We'll want to figure out the best order of execution in the context of that work. |
Some sources are trickier for adding the shutdown, so I'll address them in separate PRs. |
@stbrody @LucioFranco Is the relationship between lifetimes of out sink, returned Future, and ShutdownSIgnal documented/defined somewhere? |
Besides the docs in here https://github.com/timberio/vector/blob/master/src/shutdown.rs there may not be. But the idea is that when the root of the topology chain closes that should be bubbled all the way down to the sink that will then get dropped via the |
Ok, so I think we should define it. Something simple. Otherwise shutdown logic in the sources would get to defensive in covering every possible way that the source can be shutdown.
Shutdown scenarios:
To cover all of them, besides For some of these cases it's reasonable to assume they won't happen, or reason about what can and can't happen by looking at shutdown/topology code, which I would like to avoid. This all could be simplified if we define/document/add a few rules on what can and can't happen.
Basiclly, all of the above would guarantee that With that, shutdown scenarios for
@LucioFranco I'm maybe just complicating, but I would really like to hear what do you think? Everyone else is of course also welcome. |
We should treat this as fatal I believe. So this shouldn't happen and if it does its a bug. I believe the file server should be able to attempt to send an item down the channel and that should fail if the rx end is dropped. So if we just cancel the source future via shutdownsignal, it will drop the rx end and should then cascade the rest of the shutdown process. So I don't think its necessary for the file server to have a shutdown signal but we should ensure it closes properly if the rx end is dropped. So I would try to keep it as simple as possible and lean on futures as much as possible. |
@LucioFranco thanks, it's clearer now how this should behave. |
|
Nice work @ktff |
Issue 1091 created a SourceShutdownManager and added a ShutdownSignal object to all all source's
build()
method. Currently, however, the only sources that check for the ShutdownSignal are the TCP and UDP modes of the 'socket' source. We should update all sources to gracefully shutdown when the ShutdownSignal future resolves.docker
sourcefile
sourcehttp
sourcejournald
sourcekafka
sourcekubernetes
sourcelogplex
sourceprometheus
sourcesocket
sourcesplunk_hec
sourcestatsd
sourcestdin
sourcesyslog
sourcevector
sourceThe text was updated successfully, but these errors were encountered: