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
instance restart (reload) event #2178
Conversation
LGTM |
plugins.go
Outdated
ShutdownEvent = "shutdown" | ||
CertRenewEvent = "certrenew" | ||
InstanceStartupEvent = "instancestartup" | ||
InstanceRestart = "restart" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we make the string consistent with the name? "instancerestart"?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sure, done
plugins.go
Outdated
ShutdownEvent = "shutdown" | ||
CertRenewEvent = "certrenew" | ||
InstanceStartupEvent = "instancestartup" | ||
InstanceRestart = "instancerestart" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe it also should be InstanceRestartEvent
for consistency
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
indeed, pushed
sigtrap_posix.go
Outdated
@@ -90,6 +90,7 @@ func trapSignalsPosix() { | |||
purgeEventHooks() | |||
|
|||
// Kick off the restart; our work is done | |||
EmitEvent(InstanceRestart, nil) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You missed this one 😛 needs to be InstanceRestartEvent
too
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oops, fixed :)
Thanks! |
1. What does this change do, exactly?
New event type called restart added which is emitted at server restart (at SIGUSR1)
2. Please link to the relevant issues.
We are using caddy as embedded server and we need to make preparations before restarts
3. Which documentation changes (if any) need to be made because of this PR?
Nothing
4. Checklist