Skip to content

Commit cd84b19

Browse files
committed
Merge branch 'cherry-pick-814e18f1' into 'release/4.1'
Cherry-pick branch 'owls-112700-cohchk-stopscript' into 'main' See merge request weblogic-cloud/weblogic-kubernetes-operator!4491
2 parents 23d9cc2 + 7e5c723 commit cd84b19

File tree

15 files changed

+175
-6
lines changed

15 files changed

+175
-6
lines changed

documentation/domains/Cluster.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -376,6 +376,11 @@
376376
"Shutdown": {
377377
"type": "object",
378378
"properties": {
379+
"skipWaitingCohEndangeredState": {
380+
"default": false,
381+
"description": "For graceful shutdown only, set to true to skip waiting for Coherence Cache Cluster service MBean HAStatus in safe state before shutdown. By default, the operator will wait until it is safe to shutdown the Coherence Cache Cluster. Defaults to false.",
382+
"type": "boolean"
383+
},
379384
"ignoreSessions": {
380385
"default": false,
381386
"description": "For graceful shutdown only, indicates to ignore pending HTTP sessions during in-flight work handling. Defaults to false.",

documentation/domains/Cluster.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,7 @@ The specification of the operation of the WebLogic cluster. Required.
115115
| --- | --- | --- |
116116
| `ignoreSessions` | Boolean | For graceful shutdown only, indicates to ignore pending HTTP sessions during in-flight work handling. Defaults to false. |
117117
| `shutdownType` | string | Specifies how the operator will shut down server instances. Legal values are `Graceful` and `Forced`. Defaults to `Graceful`. |
118+
| `skipWaitingCohEndangeredState` | Boolean | For graceful shutdown only, set to true to skip waiting for Coherence Cache Cluster service MBean HAStatus in safe state before shutdown. By default, the operator will wait until it is safe to shutdown the Coherence Cache Cluster. Defaults to false. |
118119
| `timeoutSeconds` | integer | For graceful shutdown only, number of seconds to wait before aborting in-flight work and shutting down the server. Defaults to 30 seconds. |
119120
| `waitForAllSessions` | Boolean | For graceful shutdown only, set to true to wait for all HTTP sessions during in-flight work handling; false to wait for non-persisted HTTP sessions only. Defaults to false. |
120121

documentation/domains/Domain.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1187,6 +1187,11 @@
11871187
"Shutdown": {
11881188
"type": "object",
11891189
"properties": {
1190+
"skipWaitingCohEndangeredState": {
1191+
"default": false,
1192+
"description": "For graceful shutdown only, set to true to skip waiting for Coherence Cache Cluster service MBean HAStatus in safe state before shutdown. By default, the operator will wait until it is safe to shutdown the Coherence Cache Cluster. Defaults to false.",
1193+
"type": "boolean"
1194+
},
11901195
"ignoreSessions": {
11911196
"default": false,
11921197
"description": "For graceful shutdown only, indicates to ignore pending HTTP sessions during in-flight work handling. Defaults to false.",

documentation/domains/Domain.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -278,6 +278,7 @@ The current status of the operation of the WebLogic domain. Updated automaticall
278278
| --- | --- | --- |
279279
| `ignoreSessions` | Boolean | For graceful shutdown only, indicates to ignore pending HTTP sessions during in-flight work handling. Defaults to false. |
280280
| `shutdownType` | string | Specifies how the operator will shut down server instances. Legal values are `Graceful` and `Forced`. Defaults to `Graceful`. |
281+
| `skipWaitingCohEndangeredState` | Boolean | For graceful shutdown only, set to true to skip waiting for Coherence Cache Cluster service MBean HAStatus in safe state before shutdown. By default, the operator will wait until it is safe to shutdown the Coherence Cache Cluster. Defaults to false. |
281282
| `timeoutSeconds` | integer | For graceful shutdown only, number of seconds to wait before aborting in-flight work and shutting down the server. Defaults to 30 seconds. |
282283
| `waitForAllSessions` | Boolean | For graceful shutdown only, set to true to wait for all HTTP sessions during in-flight work handling; false to wait for non-persisted HTTP sessions only. Defaults to false. |
283284

kubernetes/crd/cluster-crd.yaml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ apiVersion: apiextensions.k8s.io/v1
55
kind: CustomResourceDefinition
66
metadata:
77
annotations:
8-
weblogic.sha256: 9ac551460201264f4eb69fabd7c54120c2e30492143ad81f47965567f2a7ae79
8+
weblogic.sha256: 7146de067298f75bf803e2c8acf9f88980d1d5770e375122bcbb1fe4e6f9a64b
99
name: clusters.weblogic.oracle
1010
spec:
1111
group: weblogic.oracle
@@ -2390,6 +2390,14 @@ spec:
23902390
description: Configures how the operator should shut down the
23912391
server instance.
23922392
properties:
2393+
skipWaitingCohEndangeredState:
2394+
default: false
2395+
description: For graceful shutdown only, set to true to skip
2396+
waiting for Coherence Cache Cluster service MBean HAStatus
2397+
in safe state before shutdown. By default, the operator
2398+
will wait until it is safe to shutdown the Coherence Cache
2399+
Cluster. Defaults to false.
2400+
type: boolean
23932401
ignoreSessions:
23942402
default: false
23952403
description: For graceful shutdown only, indicates to ignore

kubernetes/crd/domain-crd.yaml

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ apiVersion: apiextensions.k8s.io/v1
55
kind: CustomResourceDefinition
66
metadata:
77
annotations:
8-
weblogic.sha256: 1b5fbb6128eb44897c07ef1304cf64bc8682f7f4ef2454dde6e861a04941b635
8+
weblogic.sha256: d33dc80911f1901a703fe95438c2e4fc39271775bfecddd35893f8422d97caa3
99
name: domains.weblogic.oracle
1010
spec:
1111
group: weblogic.oracle
@@ -3331,6 +3331,14 @@ spec:
33313331
description: Configures how the operator should shut down
33323332
the server instance.
33333333
properties:
3334+
skipWaitingCohEndangeredState:
3335+
default: false
3336+
description: For graceful shutdown only, set to true to
3337+
skip waiting for Coherence Cache Cluster service MBean
3338+
HAStatus in safe state before shutdown. By default,
3339+
the operator will wait until it is safe to shutdown
3340+
the Coherence Cache Cluster. Defaults to false.
3341+
type: boolean
33343342
ignoreSessions:
33353343
default: false
33363344
description: For graceful shutdown only, indicates to
@@ -6414,6 +6422,14 @@ spec:
64146422
description: Configures how the operator should shut down the
64156423
server instance.
64166424
properties:
6425+
skipWaitingCohEndangeredState:
6426+
default: false
6427+
description: For graceful shutdown only, set to true to skip
6428+
waiting for Coherence Cache Cluster service MBean HAStatus
6429+
in safe state before shutdown. By default, the operator
6430+
will wait until it is safe to shutdown the Coherence Cache
6431+
Cluster. Defaults to false.
6432+
type: boolean
64176433
ignoreSessions:
64186434
default: false
64196435
description: For graceful shutdown only, indicates to ignore
@@ -9155,6 +9171,14 @@ spec:
91559171
the server instance.
91569172
type: object
91579173
properties:
9174+
skipWaitingCohEndangeredState:
9175+
default: false
9176+
description: For graceful shutdown only, set to true
9177+
to skip waiting for Coherence Cache Cluster service
9178+
MBean HAStatus in safe state before shutdown. By default,
9179+
the operator will wait until it is safe to shutdown
9180+
the Coherence Cache Cluster. Defaults to false.
9181+
type: boolean
91589182
ignoreSessions:
91599183
default: false
91609184
description: For graceful shutdown only, indicates to

operator/src/main/java/oracle/kubernetes/operator/helpers/PodStepContext.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -613,6 +613,11 @@ private void updateEnvForShutdown(List<V1EnvVar> env) {
613613
addDefaultEnvVarIfMissing(env, "SHUTDOWN_WAIT_FOR_ALL_SESSIONS",
614614
String.valueOf(shutdown.getWaitForAllSessions()));
615615
}
616+
if (!shutdown.getSkipWaitingCohEndangeredState()
617+
.equals(Shutdown.DEFAULT_SKIP_WAIT_COH_ENDANGERED_STATE)) {
618+
addDefaultEnvVarIfMissing(env, "SHUTDOWN_SKIP_WAIT_COH_ENDANGERED_STATE",
619+
String.valueOf(shutdown.getSkipWaitingCohEndangeredState()));
620+
}
616621
}
617622

618623
private Shutdown getShutdownSpec() {

operator/src/main/java/oracle/kubernetes/operator/steps/ShutdownManagedServerStep.java

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,16 @@ protected PortDetails getPortDetails() {
221221
private Integer getWlsServerPort() {
222222
Integer listenPort = Optional.ofNullable(getWlsServerConfig()).map(WlsServerConfig::getListenPort)
223223
.orElse(null);
224-
224+
Integer adminPort = Optional.ofNullable(getWlsServerConfig()).map(WlsServerConfig::getAdminPort)
225+
.orElse(null);
226+
Integer sslListenPort = Optional.ofNullable(getWlsServerConfig()).map(WlsServerConfig::getSslListenPort)
227+
.orElse(null);
228+
if (adminPort != null) {
229+
return adminPort;
230+
}
231+
if (sslListenPort != null) {
232+
return sslListenPort;
233+
}
225234
if (listenPort == null) {
226235
// This can only happen if the running server pod does not exist in the WLS Domain.
227236
// This is a rare case where the server was deleted from the WLS Domain config.

operator/src/main/java/oracle/kubernetes/weblogic/domain/model/BaseConfiguration.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -274,6 +274,12 @@ void addLimitRequirement(String resource, String quantity) {
274274
serverPod.addLimitRequirement(resource, quantity);
275275
}
276276

277+
void setShutdown(Shutdown shutdown) {
278+
serverPod.setShutdown(shutdown.getShutdownType(),
279+
shutdown.getTimeoutSeconds(), shutdown.getIgnoreSessions(), shutdown.getWaitForAllSessions(),
280+
shutdown.getSkipWaitingCohEndangeredState());
281+
}
282+
277283
V1PodSecurityContext getPodSecurityContext() {
278284
return Optional.ofNullable(serverPod.getPodSecurityContext()).orElse(getDefaultPodSecurityContext());
279285
}

operator/src/main/java/oracle/kubernetes/weblogic/domain/model/ServerPod.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -362,12 +362,14 @@ Shutdown getShutdown() {
362362
return this.shutdown;
363363
}
364364

365-
void setShutdown(ShutdownType shutdownType, Long timeoutSeconds, Boolean ignoreSessions, Boolean waitForAllSessions) {
365+
void setShutdown(ShutdownType shutdownType, Long timeoutSeconds, Boolean ignoreSessions, Boolean waitForAllSessions,
366+
Boolean skipWaitingCohEndangeredState) {
366367
this.shutdown
367368
.shutdownType(shutdownType)
368369
.timeoutSeconds(timeoutSeconds)
369370
.ignoreSessions(ignoreSessions)
370-
.waitForAllSessions(waitForAllSessions);
371+
.waitForAllSessions(waitForAllSessions)
372+
.skipWaitingCohEndangeredState(skipWaitingCohEndangeredState);
371373
}
372374

373375
ProbeTuning getReadinessProbeTuning() {

0 commit comments

Comments
 (0)