Does the NATS source drain messages when shutdown signal is given? #21756
-
Hi, I've been looking into the NATS source and was wondering if Vector executes a "graceful" shutdown when the SIGTERM signal occurs. Based on my understanding, the subscriber is killed after a certain point in time after the signal is given and continues to take messages until then. Should there be an additional unsubscribe() call somewhere? (or otherwise _connection.close()) |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Hi @benjamin-awd ! The expectation is that sources stop consuming when a SIGTERM is received. Any in-flight data continues to be processed until there is none or the graceful shutdown timeout is hit. For the Line 229 in 6d1d521 It is possible that an additional Are you observing the source continuing to consume messages after the shutdown signal is received? Hopefully that helps! |
Beta Was this translation helpful? Give feedback.
Hi @benjamin-awd !
The expectation is that sources stop consuming when a SIGTERM is received. Any in-flight data continues to be processed until there is none or the graceful shutdown timeout is hit. For the
nats
source, this is handled byvector/src/sources/nats.rs
Line 229 in 6d1d521
It is possible that an additional
unsubscribe()
call should be in there, though, to tell NATs to stop forwarding messages, but we may be relying on theDrop
behavior of theSubscriber
which callsunsubscribe
as you can see here: https://docs.rs/async-nats/0.37.0/src/async_…