@@ -116,7 +116,7 @@ def waitUntilCoherenceSafe():
116
116
print ('Shutdown: getting all service Coherence MBeans' )
117
117
118
118
domainRuntime ()
119
- query = 'Coherence:type=Service,name =*,*'
119
+ query = 'Coherence:type=PartitionAssignment,service =*,*'
120
120
121
121
# Wait forever until we get positive ack that it is ok to shutdown this server.
122
122
done = False
@@ -133,7 +133,7 @@ def waitUntilCoherenceSafe():
133
133
print ('Shutdown: It is safe to shutdown Coherence' )
134
134
135
135
except :
136
- print ("Shutdown: Exception checking a service Coherence statusHA , retrying..." )
136
+ print ("Shutdown: Exception checking a service Coherence HAStatus , retrying..." )
137
137
traceback .print_exc (file = sys .stdout )
138
138
dumpStack ()
139
139
systime .sleep (30 )
@@ -144,36 +144,21 @@ def waitUntilCoherenceSafe():
144
144
# If the cluster is a single node cluster then the service will always
145
145
# be ENDANGERED, therefore it is the responsibility of the user to
146
146
# set Coherence backup count to 0, or to set the terminate grace period
147
- # to a low number since this method will just wait until the oeprator kills the
147
+ # to a low number since this method will just wait until the kubernetes kills the
148
148
# pod.
149
149
def waitUntilServiceSafeToShutdown (objectName ):
150
150
151
- print ("Shutdown: checking Coherence service " + str (objectName ) )
151
+ print ("Shutdown: checking Coherence service " + str (objectName ))
152
152
153
153
# NOTE: break loop when it safe to shutdown else stay in loop forever
154
154
while (True ):
155
155
try :
156
- # If the BackupCount is > 0 then the user intention is to have
157
- # HA with backed up partitions, otherwise if value is < 1 then the user
158
- # doesn't care about HA so no need to wait.
159
- # NOTE: if this is NOT a partitioned service we will get exception, ignore and exit loop
160
- try :
161
- val = mbs .getAttribute (objectName ,"BackupCount" )
162
- except :
163
- print ("Shutdown: Coherence BackupCount attribute missing" )
164
- val = None
165
- pass
166
-
167
- if (val is None ) or int (val ) < 1 :
168
- print ("Shutdown: Coherence skipping status check for this service since BackupCount < 1. Value is " + str (val ))
169
- break
170
-
171
- status = mbs .getAttribute (objectName ,"StatusHA" )
156
+ status = mbs .getAttribute (objectName ,"HAStatus" )
172
157
if (status is None ):
173
- print ("Shutdown: None returned for Coherence StatusHA " )
158
+ print ("Shutdown: None returned for Coherence HAStatus " )
174
159
break
175
160
176
- print ('Shutdown: Coherence StatusHA is ' + status )
161
+ print ('Shutdown: Coherence HAStatus is ' + status )
177
162
if status != "ENDANGERED" :
178
163
break
179
164
0 commit comments