Skip to content

fix(shutdown): emit VectorStopped after topology drains#25083

Open
tronboto wants to merge 2 commits intovectordotdev:masterfrom
tronboto:log-message-order
Open

fix(shutdown): emit VectorStopped after topology drains#25083
tronboto wants to merge 2 commits intovectordotdev:masterfrom
tronboto:log-message-order

Conversation

@tronboto
Copy link
Copy Markdown

Summary

Vector has stopped was logged at the beginning of shutdown, before components had finished draining. This caused confusing log output where Vector has stopped appeared well before vector actually stopped, followed by continued Waiting on running components messages.

Vector configuration

sources:
  source_socket:
    type: socket
    mode: tcp
    address: 0.0.0.0:8888
    shutdown_timeout_secs: 5

sinks:
  sink_console:
    type: console
    inputs:
      - source_socket
    encoding:
      codec: json

How did you test this PR?

  • Start vector with above config
  • Connect a client to the socket source
  • Send SIGINT, SIGQUIT and double SIGINT to vector

Before (SIGINT)

^C2026-03-31T20:49:07.622604Z  INFO vector::signal: Signal received. signal="SIGINT"
2026-03-31T20:49:07.622674Z  INFO vector: Vector has stopped.
2026-03-31T20:49:07.623333Z  INFO vector::topology::running: Shutting down... Waiting on running components. remaining_components="sink_console, source_socket" time_remaining="59
 seconds left"
2026-03-31T20:49:12.623777Z  INFO vector::topology::running: Internal log [Shutting down... Waiting on running components.] is being suppressed to avoid flooding.
2026-03-31T20:49:12.625599Z  INFO source{component_kind="source" component_id=source_socket component_type=socket}:connection{peer_addr=127.0.0.1:59908}: vector::sources::util::n
et::tcp: Resetting connection (still open after seconds). seconds=5s

Now (SIGINT)

^C2026-03-31T20:49:41.059857Z  INFO vector::signal: Signal received. signal="SIGINT"
2026-03-31T20:49:41.062509Z  INFO vector::topology::running: Shutting down... Waiting on running components. remaining_components="sink_console, source_socket" time_remaining="59
 seconds left"
2026-03-31T20:49:46.062935Z  INFO vector::topology::running: Internal log [Shutting down... Waiting on running components.] is being suppressed to avoid flooding.
2026-03-31T20:49:46.062940Z  INFO source{component_kind="source" component_id=source_socket component_type=socket}:connection{peer_addr=127.0.0.1:57992}: vector::sources::util::n
et::tcp: Resetting connection (still open after seconds). seconds=5s
2026-03-31T20:49:46.064298Z  INFO vector: Vector has stopped.

Before (Interrupted shutdown)

^C2026-03-31T20:51:10.462817Z  INFO vector::signal: Signal received. signal="SIGINT"
2026-03-31T20:51:10.463056Z  INFO vector: Vector has stopped.
2026-03-31T20:51:10.463539Z  INFO vector::topology::running: Shutting down... Waiting on running components. remaining_components="source_socket, sink_console" time_remaining="59
 seconds left"
^C2026-03-31T20:51:11.360164Z  INFO vector::signal: Internal log [Signal received.] is being suppressed to avoid flooding.
2026-03-31T20:51:11.360261Z  INFO vector: Vector has quit.

Now (Interrupted shutdown)

^C2026-03-31T20:51:46.737090Z  INFO vector::signal: Signal received. signal="SIGINT"
2026-03-31T20:51:46.738376Z  INFO vector::topology::running: Shutting down... Waiting on running components. remaining_components="sink_console, source_socket" time_remaining="59
 seconds left"
^C2026-03-31T20:51:47.542837Z  INFO vector::signal: Internal log [Signal received.] is being suppressed to avoid flooding.
2026-03-31T20:51:47.543138Z  INFO vector: Vector has quit.

Change Type

  • Bug fix
  • New feature
  • Dependencies
  • Non-functional (chore, refactoring, docs)
  • Performance

Is this a breaking change?

  • Yes
  • No

Does this PR include user facing changes?

  • Yes. Please add a changelog fragment based on our guidelines.
  • No. A maintainer will apply the no-changelog label to this PR.

References

Notes

  • Please read our Vector contributor resources.
  • Do not hesitate to use @vectordotdev/vector to reach out to us regarding this PR.
  • Some CI checks run only after we manually approve them.
    • We recommend adding a pre-push hook, please see this template.
    • Alternatively, we recommend running the following locally before pushing to the remote branch:
      • make fmt
      • make check-clippy (if there are failures it's possible some of them can be fixed with make clippy-fix)
      • make test
  • After a review is requested, please avoid force pushes to help us review incrementally.
    • Feel free to push as many commits as you want. They will be squashed into one before merging.
    • For example, you can run git merge origin master and git push.
  • If this PR introduces changes Vector dependencies (modifies Cargo.lock), please
    run make build-licenses to regenerate the license inventory and commit the changes (if any). More details on the dd-rust-license-tool.

@tronboto tronboto requested a review from a team as a code owner March 31, 2026 20:58
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 31, 2026

All contributors have signed the CLA ✍️ ✅
Posted by the CLA Assistant Lite bot.

@tronboto
Copy link
Copy Markdown
Author

I have read the CLA Document and I hereby sign the CLA

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Log message order when vector shuts down is confusing

1 participant