Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Match --signal PIDs with globular-style expression. #4370

Merged
merged 1 commit into from Aug 9, 2023

Conversation

jevolk
Copy link
Contributor

@jevolk jevolk commented Aug 5, 2023

When multiple instances are running on the machine a PID argument suffixed with a '*' character will signal all matching PIDs.

Example: nats-server --signal reload=*

  • Link to issue, e.g. Resolves #NNN
  • Documentation added (if applicable)
  • Tests added
  • Branch rebased on top of current main dev
  • Changes squashed to a single commit (described here)
  • Build is green in Travis CI
  • You have certified that the contribution is your original work and that you license the work to the project under the Apache 2 license

@jevolk jevolk requested a review from a team as a code owner August 5, 2023 02:19
@jevolk jevolk force-pushed the jevolk/signālia branch 2 times, most recently from 70778dc to 873be56 Compare August 5, 2023 05:27
Copy link
Member

@bruth bruth left a comment

Choose a reason for hiding this comment

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

Other than the minor comment, LGTM!. Thanks for the contribution!

server/signal.go Outdated
if errStr != "" {
return errors.New(errStr)
}
return err
Copy link
Member

Choose a reason for hiding this comment

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

This is a nit, but it appears safe to return nil here since in all other cases above, an non-nil err value was returned appropriately. IMO, it helps with readability indicating that there is not fact not an error value that could propagate down this far.

@jevolk
Copy link
Contributor Author

jevolk commented Aug 6, 2023

Thanks for taking the time to review this so quickly. I have made the requested change. I have also added another test to ensure coverage for partial matches with a trailing glob.

Copy link
Member

@neilalexander neilalexander left a comment

Choose a reason for hiding this comment

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

LGTM, thanks!

Just one final thing, would appreciate if you can add a Signed-off-by: to the commit message for your Apache 2 sign-off.

When multiple instances are running on the machine a PID argument suffixed with
a '*' character will signal all matching PIDs.

Example: `nats-server --signal reload=*`

Signed-off-by: Jason Volk <jason@zemos.net>
@neilalexander neilalexander merged commit 617d69d into nats-io:dev Aug 9, 2023
1 check passed
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.

None yet

3 participants