Skip to content

fix(windows platform): correct stop/start state checks and add configurable stop timeout#24772

Open
iMithrellas wants to merge 3 commits intovectordotdev:masterfrom
iMithrellas:fix/windows-service-stop-wait
Open

fix(windows platform): correct stop/start state checks and add configurable stop timeout#24772
iMithrellas wants to merge 3 commits intovectordotdev:masterfrom
iMithrellas:fix/windows-service-stop-wait

Conversation

@iMithrellas
Copy link

@iMithrellas iMithrellas commented Feb 26, 2026

Summary

This PR fixes Windows service control state checks in the start/stop paths and improves shutdown behavior.

  • Corrects conditional logic in service state checks that could previously never evaluate false.
  • Ensures vector service stop waits until the service reaches Stopped before returning.
  • Adds --stop-timeout to vector service stop and vector service uninstall to make shutdown wait duration configurable.

Vector configuration

Used standard Windows service installation flow with existing Vector service configuration.
No config schema changes were required for this PR.

How did you test this PR?

  • Ran cargo fmt --all.
  • Manually tested Windows service control commands on Windows:
    • vector service stop --stop-timeout <seconds>
    • vector service uninstall --stop-timeout <seconds>
    • Internal install/uninstall/update scripts now work as expected.
  • Verified behavior matches expected service lifecycle transitions and completes successfully.

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.

Notes

Includes changelog fragment:

  • changelog.d/windows_service_stop_state_wait.fix.md
    Implementation was prepared with LLM assistance; please review carefully.

@iMithrellas iMithrellas requested a review from a team as a code owner February 26, 2026 11:44
@github-actions
Copy link

github-actions bot commented Feb 26, 2026

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

@iMithrellas
Copy link
Author

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

@iMithrellas iMithrellas changed the title fix(windows service): correct stop/start state checks and add configurable stop timeout fix(windows platform): correct stop/start state checks and add configurable stop timeout Feb 26, 2026
@iMithrellas iMithrellas force-pushed the fix/windows-service-stop-wait branch from 23b030f to 0719c4b Compare February 26, 2026 11:49
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.

1 participant