Skip to content

Commit 6401c80

Browse files
committed
Work in progress
1 parent d537b1c commit 6401c80

File tree

2 files changed

+15
-7
lines changed

2 files changed

+15
-7
lines changed

src/main/java/oracle/kubernetes/operator/Main.java

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939
import oracle.kubernetes.weblogic.domain.v1.DomainList;
4040
import oracle.kubernetes.weblogic.domain.v1.DomainSpec;
4141
import oracle.kubernetes.weblogic.domain.v1.ServerStartup;
42+
import oracle.kubernetes.operator.builders.WatchBuilder;
4243
import oracle.kubernetes.operator.helpers.CRDHelper;
4344
import oracle.kubernetes.operator.helpers.CallBuilder;
4445
import oracle.kubernetes.operator.helpers.ClientHelper;
@@ -85,29 +86,30 @@ public class Main {
8586
private static final String PODWATCHER_COMPONENT_NAME = "podWatcher";
8687

8788
private static final Engine engine = new Engine("operator");
88-
89+
8990
private static final LoggingFacade LOGGER = LoggingFactory.getLogger("Operator", "Operator");
9091
private static final FiberGate domainUpdaters = new FiberGate(engine);
9192
private static final ConcurrentMap<String, DomainPresenceInfo> domains = new ConcurrentHashMap<String, DomainPresenceInfo>();
9293

9394
private static final ConfigMapConsumer config = new ConfigMapConsumer("/operator/config");
94-
95+
9596
// tuning parameters
9697
private static final int statusUpdateTimeoutSeconds = (int) readTuningParameter("statusUpdateTimeoutSeconds", 10);
97-
private static final int unchangedCountToDelayStatusRecheck = (int) readTuningParameter("unchangedCountToDelayStatusRecheck", 10);
98-
private static final long initialShortDelay = readTuningParameter("initialShortDelay", 3);
99-
private static final long eventualLongDelay = readTuningParameter("eventualLongDelay", 30);
100-
98+
private static final int unchangedCountToDelayStatusRecheck = (int) readTuningParameter("statueUpdateUnchangedCountToDelayStatusRecheck", 10);
99+
private static final long initialShortDelay = readTuningParameter("statusUpdateInitialShortDelay", 3);
100+
private static final long eventualLongDelay = readTuningParameter("statusUpdateEventualLongDelay", 30);
101101
static {
102102
int callRequestLimit = (int) readTuningParameter("callRequestLimit", 500);
103103
int callMaxRetryCount = (int) readTuningParameter("callMaxRetryCount", 5);
104104
int callTimeoutSeconds = (int) readTuningParameter("callTimeoutSeconds", 10);
105105
CallBuilder.setTuningParameters(callRequestLimit, callMaxRetryCount, callTimeoutSeconds);
106+
int watchLifetime = (int) readTuningParameter("watchLifetime", 45);
107+
WatchBuilder.setTuningParameters(watchLifetime);
106108
}
107109

108110
private static final ConcurrentMap<String, Boolean> initialized = new ConcurrentHashMap<>();
109111
private static final AtomicBoolean stopping = new AtomicBoolean(false);
110-
112+
111113
private static String principal;
112114
private static RestServer restServer = null;
113115
private static Thread livenessThread = null;

src/main/java/oracle/kubernetes/operator/builders/WatchBuilder.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,11 @@
2222

2323
@SuppressWarnings("WeakerAccess")
2424
public class WatchBuilder {
25+
private static int watchLifetime = 30;
26+
27+
public static void setTuningParameters(int watchLifetime) {
28+
WatchBuilder.watchLifetime = watchLifetime;
29+
}
2530

2631
/** Always true for watches. */
2732
private static final boolean WATCH = true;
@@ -40,6 +45,7 @@ public interface WatchFactory {
4045

4146
public WatchBuilder(ClientHolder clientHolder) {
4247
this.clientHolder = clientHolder;
48+
callParams.setTimeoutSeconds(watchLifetime);
4349
}
4450

4551
private static Type getType(Class<?> responseBodyType) {

0 commit comments

Comments
 (0)