Remove connection from worker if in terminated state and all conns are closed, not just in canceling state
This commit is contained in:
1 parent
d1d94c19c8
commit
8615d21a1f
1 file changed
+4
-2
@@ -137,8 +137,10 @@ func (w *Worker) startStatusTicking(cancelCtx context.Context) {
|
||||
w.sessionInfoMap.Range(func(key, value interface{}) bool {
|
||||
si := value.(*sessionInfo)
|
||||
si.Lock()
|
||||
if time.Until(si.lookupSessionResponse.Expiration.AsTime()) < 0 ||
|
||||
si.status == pbs.SESSIONSTATUS_SESSIONSTATUS_CANCELING {
|
||||
switch {
|
||||
case si.status == pbs.SESSIONSTATUS_SESSIONSTATUS_CANCELING,
|
||||
si.status == pbs.SESSIONSTATUS_SESSIONSTATUS_TERMINATED,
|
||||
time.Until(si.lookupSessionResponse.Expiration.AsTime()) < 0:
|
||||
var toClose int
|
||||
for k, v := range si.connInfoMap {
|
||||
if v.closeTime.IsZero() {
|
||||
|
||||
Reference in new issue
Block a user