Skip to content

Commit

Permalink
Merge pull request quarkusio#19857 from stuartwdouglas/hang-detector-fix
Browse files Browse the repository at this point in the history
Clean up hang detection on failed start
  • Loading branch information
stuartwdouglas authored Sep 2, 2021
2 parents bc4dc0a + ebddbc3 commit d4084fb
Showing 1 changed file with 14 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -435,15 +435,7 @@ public void close() throws IOException {
} finally {
tcclMethodCache.clear();
GroovyCacheCleaner.clearGroovyCache();
if (hangTaskKey != null) {
hangTaskKey.cancel(true);
hangTaskKey = null;
}
var h = hangDetectionExecutor;
if (h != null) {
h.shutdownNow();
hangDetectionExecutor = null;
}
shutdownHangDetection();
}
}
try {
Expand Down Expand Up @@ -472,6 +464,18 @@ public void close() throws IOException {
}
}

private void shutdownHangDetection() {
if (hangTaskKey != null) {
hangTaskKey.cancel(true);
hangTaskKey = null;
}
var h = hangDetectionExecutor;
if (h != null) {
h.shutdownNow();
hangDetectionExecutor = null;
}
}

private void populateDeepCloneField(StartupAction startupAction) {
deepClone = new SerializationWithXStreamFallbackDeepClone(startupAction.getClassLoader());
}
Expand Down Expand Up @@ -1333,6 +1337,7 @@ class FailedCleanup implements ExtensionContext.Store.CloseableResource {

@Override
public void close() {
resetHangTimeout();
firstException = null;
failedBoot = false;
ConfigProviderResolver.setInstance(null);
Expand Down

0 comments on commit d4084fb

Please sign in to comment.