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

fix: improved error handling in signer module loading #1990

Merged
merged 2 commits into from
Mar 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ private static InitializeArgs getInitializeArgs(Boolean libraryCantCreateOsThrea

@Override
public void stop() {
super.stop();
if (pkcs11Module == null) {
return;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ test-automation:
browser-size: "1280x900"
driver-manager-enabled: true
headless: true
chrome-options-args: "--guest,--disable-features=OptimizationHints"
timeout: 10000
page-load-timeout: 10000
screenshots: true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ test-automation:
browser-size: "1920x1080"
driver-manager-enabled: true
headless: true
chrome-options-args: "--guest,--disable-features=OptimizationHints"
timeout: 15000
page-load-timeout: 25000
screenshots: true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,13 @@ public void refresh() {
mergeConfiguration();
}

moduleWorkers.forEach((key, worker) -> worker.refresh());
moduleWorkers.forEach((key, worker) -> {
try {
worker.refresh();
} catch (Exception e) {
log.error("Error refreshing module '{}'.", key);
}
});

if (!SLAVE.equals(serverNodeType)) {
persistConfiguration();
Expand Down Expand Up @@ -233,7 +239,7 @@ private Map<String, AbstractModuleWorker> loadModules(Collection<ModuleType> mod

newModules.put(moduleWorker.getModuleType().getType(), moduleWorker);
} catch (Exception e) {
throw new RuntimeException(e);
log.error("Error loading module '{}'.", moduleType, e);
}
});
return newModules;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,12 @@ public void refresh() {
}
}

@Override
public void stop() {
stopLostTokenWorkers(tokenWorkers, List.of());
tokenWorkers = Collections.emptyMap();
}

protected abstract List<TokenType> listTokens() throws Exception;

protected abstract AbstractTokenWorker createWorker(TokenInfo tokenInfo, TokenType tokenType);
Expand Down
Loading