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

*: Handle SIGHUP #2139

Merged
merged 3 commits into from
Feb 17, 2020
Merged

*: Handle SIGHUP #2139

merged 3 commits into from
Feb 17, 2020

Conversation

kakkoyun
Copy link
Member

This PR handles received SIGHUP signals and dispatches reload events to sub-commands to handle.
Only the ruler utilizes this right now. Receiver and Ruler implement their own file watchers to reload configurations.

Fixes #1333.

  • I added CHANGELOG entry for this change.
  • Change is not relevant to the end user.

Changes

Verification

  • make test-local
  • MINIO_ENABLED=1 ./scripts/quickstart.sh
    • kill -HUP <thanos-pid>

Signed-off-by: Kemal Akkoyun <kakkoyun@gmail.com>
Signed-off-by: Kemal Akkoyun <kakkoyun@gmail.com>
cmd/thanos/main.go Outdated Show resolved Hide resolved
Signed-off-by: Kemal Akkoyun <kakkoyun@gmail.com>
Copy link
Member

@bwplotka bwplotka left a comment

Choose a reason for hiding this comment

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

Nice! Some suggestion. Especially if no one is actually receiving the channel, we might leak some memory (?).

cmd/thanos/main.go Show resolved Hide resolved
@kakkoyun
Copy link
Member Author

@bwplotka Should I move handling logic per subcommand? or is this good enough?

Copy link
Member

@bwplotka bwplotka left a comment

Choose a reason for hiding this comment

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

No, that's fine for now. Thanks 👍

@bwplotka bwplotka merged commit 01cee87 into thanos-io:master Feb 17, 2020
@kakkoyun kakkoyun deleted the sighup branch February 17, 2020 15:47
vankop pushed a commit to monitoring-tools/thanos that referenced this pull request Feb 28, 2020
* Handle SIGHUP

Signed-off-by: Kemal Akkoyun <kakkoyun@gmail.com>

* Only log when signal received

Signed-off-by: Kemal Akkoyun <kakkoyun@gmail.com>

* Use a buffered channel

Signed-off-by: Kemal Akkoyun <kakkoyun@gmail.com>
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.

Handle SIGHUP event
2 participants