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

Deprecate and remove the reload hook #5307

Closed
christophermaier opened this issue Jul 10, 2018 · 6 comments
Closed

Deprecate and remove the reload hook #5307

christophermaier opened this issue Jul 10, 2018 · 6 comments
Assignees
Labels
Focus:Supervisor ProcessManagement Related to how the Supervisor manages service processes Focus:Supervisor Related to the Habitat Supervisor (core/hab-sup) component Type:Additional Discussion Type:Breaking Change PRs that are classified as a change to existing behavior Type: Bug Issues that describe broken functionality

Comments

@christophermaier
Copy link
Contributor

christophermaier commented Jul 10, 2018

Based on #5306 the intended purpose of the reload hook is unclear.

Based on

/// Runs the reconfigure hook if present, otherwise restarts the service.
fn reload(&mut self, launcher: &LauncherCli) {
self.needs_reload = false;
if self.process_down() || self.hooks.reload.is_none() {
if let Some(err) = self.supervisor
.restart(
&self.pkg,
&self.service_group,
launcher,
self.svc_encrypted_password.as_ref(),
)
.err()
{
outputln!(preamble self.service_group, "Service restart failed: {}", err);
}
} else {
let hook = self.hooks.reload.as_ref().unwrap();
hook.run(
&self.service_group,
&self.pkg,
self.svc_encrypted_password.as_ref(),
);
}
}
, it appears that reload is intended to be a substitute for restarting the service, but it's not clear how this can actually work in practice, given that the Launcher is the thing that owns the actual process.

If we re-organize the hook invocations as detailed in #5306, it's unclear what reload is really accomplishing. It is likely that it is a vestige of the time before the Launcher, and possibly before the multi-service Supervisor; we may lose nothing by removing it (subject to appropriate deprecation notices, of course).

There are several other issues for hooks and other methods of dealing with various aspects of service shutdown that may be interesting to consider here:

@baumanj
Copy link
Contributor

baumanj commented Jul 11, 2018

it appears that reload is intended to be a substitute for restarting the service, but it's not clear how this can actually work in practice, given that the Launcher is the thing that owns the actual process

Can you elaborate? Launcher owns the process, but the supervisor can still kill it and direct launcher to restart it. I must be missing what you're getting at.

@christophermaier
Copy link
Contributor Author

I mean that I'm not clear what running a script (the alternative to which is having the Launcher restart a service) would do to "reload" a service that wouldn't mess up the bookkeeping that the Launcher already does.

@baumanj
Copy link
Contributor

baumanj commented Jul 11, 2018

Ah, I think I understand. If I think of it in terms of what is possible with load/unload, it would make sense that it could be used as a signal to changes of bindings and such. Would in make more sense if we had something like hab config edit?

@christophermaier
Copy link
Contributor Author

I haven't fully plumbed the depths of Git history on this yet, but it seems that at some point that reload was actually intended as reconfigure: 9e1203f, but somehow we ended up with both.

I'm not sure exactly how these wires got crossed, but if that is the case, it does suggest that reload could go away.

@christophermaier
Copy link
Contributor Author

See also #1838

@christophermaier christophermaier added the Focus:Supervisor ProcessManagement Related to how the Supervisor manages service processes label Nov 30, 2018
@christophermaier christophermaier changed the title Is a reload hook even necessary? Deprecate and remove the reload hook Dec 10, 2018
@davidMcneil davidMcneil self-assigned this Jun 7, 2019
davidMcneil added a commit that referenced this issue Jun 18, 2019
davidMcneil added a commit that referenced this issue Jun 20, 2019
Resolves #5305 #5306 #5307

Signed-off-by: David McNeil <[email protected]>

PR feedback

Signed-off-by: David McNeil <[email protected]>
davidMcneil added a commit that referenced this issue Jun 21, 2019
Resolves #5305 #5306 #5307

Signed-off-by: David McNeil <[email protected]>

PR feedback

Signed-off-by: David McNeil <[email protected]>
davidMcneil added a commit that referenced this issue Jun 26, 2019
Resolves #5305 #5306 #5307

Signed-off-by: David McNeil <[email protected]>

PR feedback

Signed-off-by: David McNeil <[email protected]>
davidMcneil added a commit that referenced this issue Jul 2, 2019
Resolves #5305 #5306 #5307

Signed-off-by: David McNeil <[email protected]>

PR feedback

Signed-off-by: David McNeil <[email protected]>
davidMcneil added a commit that referenced this issue Jul 7, 2019
Resolves #5305 #5306 #5307

Signed-off-by: David McNeil <[email protected]>

PR feedback

Signed-off-by: David McNeil <[email protected]>
davidMcneil added a commit that referenced this issue Jul 8, 2019
Resolves #5305 #5306 #5307

Signed-off-by: David McNeil <[email protected]>

PR feedback

Signed-off-by: David McNeil <[email protected]>
davidMcneil added a commit that referenced this issue Jul 17, 2019
Resolves #5305 #5306 #5307

Signed-off-by: David McNeil <[email protected]>

PR feedback

Signed-off-by: David McNeil <[email protected]>
@davidMcneil
Copy link
Contributor

Resolved by #6668

@christophermaier christophermaier added Type:Breaking Change PRs that are classified as a change to existing behavior Focus:Supervisor Related to the Habitat Supervisor (core/hab-sup) component Type: Bug Issues that describe broken functionality and removed X-change labels Jul 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Focus:Supervisor ProcessManagement Related to how the Supervisor manages service processes Focus:Supervisor Related to the Habitat Supervisor (core/hab-sup) component Type:Additional Discussion Type:Breaking Change PRs that are classified as a change to existing behavior Type: Bug Issues that describe broken functionality
Projects
None yet
Development

No branches or pull requests

4 participants