mirror of
https://github.com/mudler/LocalAI.git
synced 2026-09-29 17:44:30 -04:00
fix(failover): free the leader lock soon after the leader's host dies
A leader whose host died without closing its connection kept the advisory lock for about two hours of OS keepalive defaults, and no other frontend could probe. The lock session now sets short TCP keepalives and tcp_user_timeout, so the server drops it within about 30 seconds. Shutdown now closes the lock for good, so a tick that runs after it cannot take the lock back. Assisted-by: Claude:claude-opus-5-5 Signed-off-by: Ettore Di Giacinto <mudler@localai.io>
This commit is contained in:
1 parent
b5792e4d17
commit
e59fb854ee
4 files changed
+175
-31
No files matched your search
@@ -87,6 +87,8 @@ func (a *Application) stopFailoverDistributed() {
|
||||
}
|
||||
}
|
||||
if a.failoverLock != nil {
|
||||
a.failoverLock.Release()
|
||||
// Close, not Release: Run may still be ticking and would take the
|
||||
// lock straight back.
|
||||
a.failoverLock.Close()
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user