Skip to content

Commit bc56d4c

Browse files
committed
code cleanup
1 parent 9c1c67d commit bc56d4c

4 files changed

Lines changed: 9 additions & 7 deletions

File tree

tools/server-boot/src/main/dist/config/application.properties

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,5 @@ management.server.port=-1
77
management.endpoints.enabled-by-default=false
88
management.endpoints.web.exposure.exclude=*
99

10-
# Prevent Spring Boot from auto-configuring Solr unless explicitly requested.
11-
rdf4j.solr.enabled=false
12-
1310
# Keep existing classpath defaults (e.g. bean definition overriding) by loading this file via
1411
# spring.config.additional-location rather than replacing the built-in configuration.

tools/server-boot/src/main/java/org/eclipse/rdf4j/tools/serverboot/SignalShutdownHandler.java

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,22 +73,29 @@ private void handleSignal(String signalName) {
7373

7474
logger.info("SIG{} received; initiating graceful shutdown.", signalName);
7575
ConfigurableApplicationContext context = contextRef.get();
76+
int exitCode = 0;
7677
if (context != null) {
7778
try {
78-
int exitCode = SpringApplication.exit(context, () -> 0);
79+
exitCode = SpringApplication.exit(context, () -> 0);
7980
if (context.isActive()) {
8081
context.close();
8182
}
8283
logger.info("Application context closed after SIG{}, exit status {}", signalName, exitCode);
83-
System.exit(exitCode);
8484
} catch (Throwable e) {
8585
logger.warn("Error while shutting down after SIG{}", signalName, e);
86+
exitCode = 1;
8687
}
8788
} else {
8889
logger.warn("SIG{} received before application context became available; shutting down immediately.",
8990
signalName);
9091
}
9192

93+
try {
94+
System.exit(exitCode);
95+
} catch (SecurityException e) {
96+
logger.error("System.exit({}) blocked by security manager after SIG{}", exitCode, signalName, e);
97+
}
98+
9299
}
93100

94101
private static void startDelayedSystemExitThread(String signalName) {
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
11
org.springframework.boot.env.EnvironmentPostProcessor=\
2-
org.eclipse.rdf4j.tools.serverboot.config.SolrAutoConfigurationDisabler
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
11
spring.main.allow-bean-definition-overriding=true
2-
rdf4j.solr.enabled=false

0 commit comments

Comments
 (0)