Skip to content

Commit

Permalink
Clean up hang detection on failed start
Browse files Browse the repository at this point in the history
This can cause a false positive in the vertx-http-deployment tests where
a continuous test fails to start, then spits out a hang detection
warning a minute later.
  • Loading branch information
stuartwdouglas committed Sep 2, 2021
1 parent dc7af63 commit ebddbc3
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 ebddbc3

Please sign in to comment.