diff --git a/packages/debian/changelog b/packages/debian/changelog index 504aefd7e..54be6ca57 100644 --- a/packages/debian/changelog +++ b/packages/debian/changelog @@ -11,6 +11,7 @@ cgrates (0.10.3~dev) UNRELEASED; urgency=medium * [FilterS] Optimized the automated index fields matching * [AgentS] Added *routes_maxcost flag * [SessionS] Replaced max_call_duration config with default_usage for each ToR + * [SessionS] The sessions are no longer terminated on shutdown if the replication_conns are set -- DanB Thu, 08 Oct 2020 16:23:58 +0300 diff --git a/sessions/sessions.go b/sessions/sessions.go index a8eca8d74..1c2c898c5 100644 --- a/sessions/sessions.go +++ b/sessions/sessions.go @@ -118,8 +118,16 @@ func (sS *SessionS) ListenAndServe(exitChan chan bool) (err error) { // Shutdown is called by engine to clear states func (sS *SessionS) Shutdown() (err error) { - for _, s := range sS.getSessions("", false) { // Force sessions shutdown - sS.terminateSession(s, nil, nil, nil, false) + if len(sS.cgrCfg.SessionSCfg().ReplicationConns) == 0 { + var hasErr bool + for _, s := range sS.getSessions("", false) { // Force sessions shutdown + if err = sS.terminateSession(s, nil, nil, nil, false); err != nil { + hasErr = true + } + } + if hasErr { + return utils.ErrPartiallyExecuted + } } return }