Skip to content

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

Merged
pront merged 7 commits intovectordotdev:masterfrom
tronboto:log-message-order
Apr 8, 2026
Merged

fix(shutdown): emit VectorStopped after topology drains#25083
pront merged 7 commits intovectordotdev:masterfrom
tronboto:log-message-order

Conversation

@tronboto
Copy link
Copy Markdown
Contributor

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
Contributor Author

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

@pront
Copy link
Copy Markdown
Member

pront commented Apr 8, 2026

@codex review

Copy link
Copy Markdown
Member

@pront pront left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @tronboto, this makes sense to me.

@pront pront enabled auto-merge April 8, 2026 17:28
@chatgpt-codex-connector
Copy link
Copy Markdown

Codex Review: Didn't find any major issues. 🎉

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@pront pront disabled auto-merge April 8, 2026 17:30
@pront pront enabled auto-merge April 8, 2026 20:07
@pront pront added this pull request to the merge queue Apr 8, 2026
Merged via the queue into vectordotdev:master with commit 9c4abf3 Apr 8, 2026
57 of 58 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Apr 8, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

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

2 participants