Remove connection from worker if in terminated state and all conns are closed, not just in canceling state

pull/526/head
Jeff Mitchell 5 years ago
parent d1d94c19c8
commit 8615d21a1f

@ -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() {

Loading…
Cancel
Save