Ensure that context is destroyed on restart

This commit is contained in:
René Pfeuffer
2020-03-25 16:52:53 +01:00
parent 15aab3059d
commit 24c7cb0b67
6 changed files with 57 additions and 31 deletions

View File

@@ -33,7 +33,7 @@ import static sonia.scm.lifecycle.CLibrary.*;
/**
* Restart strategy which uses execvp from libc. This strategy is only supported on posix base operating systems.
*/
class PosixRestartStrategy implements RestartStrategy {
class PosixRestartStrategy extends RestartStrategy {
private static final Logger LOG = LoggerFactory.getLogger(PosixRestartStrategy.class);
@@ -41,10 +41,7 @@ class PosixRestartStrategy implements RestartStrategy {
}
@Override
public void restart(InjectionContext context) {
LOG.warn("destroy injection context");
context.destroy();
protected void executeRestart(InjectionContext context) {
LOG.warn("restart scm-manager jvm process");
try {
restart();