Skip to content

Commit a518fa8

Browse files
committed
Log warning when app recovery and HA are used together
1 parent 2e9a9ca commit a518fa8

2 files changed

Lines changed: 8 additions & 2 deletions

File tree

src/main/java/eu/openanalytics/containerproxy/ContainerProxyApplication.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,8 @@
8181
import java.util.concurrent.Executor;
8282

8383
import static eu.openanalytics.containerproxy.api.ApiSecurityService.PROP_API_SECURITY_HIDE_SPEC_DETAILS;
84+
import static eu.openanalytics.containerproxy.service.AppRecoveryService.PROPERTY_RECOVER_RUNNING_PROXIES;
85+
import static eu.openanalytics.containerproxy.service.AppRecoveryService.PROPERTY_RECOVER_RUNNING_PROXIES_FROM_DIFFERENT_CONFIG;
8486
import static eu.openanalytics.containerproxy.service.ProxyService.PROPERTY_STOP_PROXIES_ON_SHUTDOWN;
8587

8688
@EnableScheduling
@@ -170,6 +172,10 @@ public void init() {
170172
// running in HA mode, but proxies are removed when shutting down
171173
log.warn("WARNING: Invalid configuration detected: store-mode is set to Redis (i.e. High-Availability mode), but proxies are stopped at shutdown of server!");
172174
}
175+
if (environment.getProperty( PROPERTY_RECOVER_RUNNING_PROXIES, Boolean.class, false) ||
176+
environment.getProperty( PROPERTY_RECOVER_RUNNING_PROXIES_FROM_DIFFERENT_CONFIG, Boolean.class, false) ) {
177+
log.warn("WARNING: Invalid configuration detected: cannot use store-mode with Redis (i.e. High-Availability mode) and app recovery at the same time. Disable app recovery!");
178+
}
173179
}
174180

175181
boolean hideSpecDetails = environment.getProperty(PROP_API_SECURITY_HIDE_SPEC_DETAILS, Boolean.class, true);

src/main/java/eu/openanalytics/containerproxy/service/AppRecoveryService.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,8 @@
5252
@Service
5353
public class AppRecoveryService {
5454

55-
protected static final String PROPERTY_RECOVER_RUNNING_PROXIES = "proxy.recover-running-proxies";
56-
protected static final String PROPERTY_RECOVER_RUNNING_PROXIES_FROM_DIFFERENT_CONFIG = "proxy.recover-running-proxies-from-different-config";
55+
public static final String PROPERTY_RECOVER_RUNNING_PROXIES = "proxy.recover-running-proxies";
56+
public static final String PROPERTY_RECOVER_RUNNING_PROXIES_FROM_DIFFERENT_CONFIG = "proxy.recover-running-proxies-from-different-config";
5757

5858
private final Logger log = LogManager.getLogger(AppRecoveryService.class);
5959

0 commit comments

Comments
 (0)