Skip to content

nixos/vector: add graceful shutdown limit option#414311

Merged
happysalada merged 1 commit intoNixOS:masterfrom
nionata:nji/vector-graceful-shutdown-limit
Jun 12, 2025
Merged

nixos/vector: add graceful shutdown limit option#414311
happysalada merged 1 commit intoNixOS:masterfrom
nionata:nji/vector-graceful-shutdown-limit

Conversation

@nionata
Copy link
Contributor

@nionata nionata commented Jun 5, 2025

Add an option to the vector module to set the graceful shutdown limit added in vectordotdev/vector#17479. The option default mirrors the default from the vector cli. Alternatively, the option could be null as to be a no-op if it is not specified.

Eval and ExecStart output testing:

nix eval .#nixosTests.vector.api.nodes.machineapi.systemd.services.vector.serviceConfig.ExecStart
"/nix/store/870ikdmdf59v51shbrcqb7mpj34ddk4w-vector-0.47.0/bin/vector --config /nix/store/rpvw5mll6miahra8p96l456a6hj0sqhy-validate-vector-conf --graceful-shutdown-limit-secs 60

/nix/store/870ikdmdf59v51shbrcqb7mpj34ddk4w-vector-0.47.0/bin/vector --config /nix/store/rpvw5mll6miahra8p96l456a6hj0sqhy-validate-vector-conf --graceful-shutdown-limit-secs 60
...
^C2025-06-05T18:56:11.497323Z  INFO vector::signal: Signal received. signal="SIGINT"
2025-06-05T18:56:11.497521Z  INFO vector: Vector has stopped.
2025-06-05T18:56:11.499044Z  INFO vector::topology::running: Shutting down... Waiting on running components. remaining_components="demo_logs, file" time_remaining="59 seconds left"

/nix/store/870ikdmdf59v51shbrcqb7mpj34ddk4w-vector-0.47.0/bin/vector --config /nix/store/rpvw5mll6miahra8p96l456a6hj0sqhy-validate-vector-conf --graceful-shutdown-limit-secs 1
...
^C2025-06-05T18:56:20.408502Z  INFO vector::signal: Signal received. signal="SIGINT"
2025-06-05T18:56:20.408671Z  INFO vector: Vector has stopped.
2025-06-05T18:56:20.410253Z  INFO vector::topology::running: Shutting down... Waiting on running components. remaining_components="demo_logs, file" time_remaining="0 seconds left"

nixosTests:

nix-build -A nixosTests.vector

Things done

  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandboxing enabled in nix.conf? (See Nix manual)
    • sandbox = relaxed
    • sandbox = true
  • Tested, as applicable:
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
  • Tested basic functionality of all binary files (usually in ./result/bin/)
  • Nixpkgs 25.11 Release Notes (or backporting 24.11 and 25.05 Nixpkgs Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
  • NixOS 25.11 Release Notes (or backporting 24.11 and 25.05 NixOS Release notes)
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
  • Fits CONTRIBUTING.md.

Add a 👍 reaction to pull requests you find important.

@github-actions github-actions bot added 6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS 8.has: module (update) This PR changes an existing module in `nixos/` 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. labels Jun 5, 2025
Copy link
Member

@dotlambda dotlambda left a comment

Choose a reason for hiding this comment

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

@nionata nionata changed the title feat(vector): Add graceful shutdown limit module option nixos/vector: add graceful shutdown limit option Jun 5, 2025
@dotlambda
Copy link
Member

Please squash.

@nionata
Copy link
Contributor Author

nionata commented Jun 5, 2025

Please read https://github.com/NixOS/nixpkgs/blob/master/nixos/README.md#commit-conventions.

Thanks. I updated the PR title to comply with that format. Is that sufficient? Or is it desirable that I force push?

@dotlambda
Copy link
Member

Please read https://github.com/NixOS/nixpkgs/blob/master/nixos/README.md#commit-conventions.

Thanks. I updated the PR title to comply with that format. Is that sufficient? Or is it desirable that I force push?

The latter.

This adds a NixOS module option to configure the Vector cli option
`--graceful-shutdown-limit-secs`,
https://vector.dev/docs/reference/cli/#vector_graceful_shutdown_limit_secs.
@nionata nionata force-pushed the nji/vector-graceful-shutdown-limit branch from e581f72 to 25a40ea Compare June 5, 2025 21:39
@wegank wegank added the 12.approvals: 1 This PR was reviewed and approved by one person. label Jun 9, 2025
@happysalada happysalada merged commit 645c320 into NixOS:master Jun 12, 2025
18 of 19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS 8.has: module (update) This PR changes an existing module in `nixos/` 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. 12.approvals: 1 This PR was reviewed and approved by one person.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants