Skip to content

Commit

Permalink
hard exit 3 when loosing leadership
Browse files Browse the repository at this point in the history
Gracefully shutting down can cause locking when compacted files are
tried to be replicated. The OS will clean up all memory sockets etc.
  • Loading branch information
carlhoerberg authored and kickster97 committed Dec 16, 2024
1 parent 72d9257 commit dd15a67
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/lavinmq/launcher.cr
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,8 @@ module LavinMQ
loop do
if leadership = @leadership
if leadership.wait(30.seconds)
Log.warn { "Lost leadership" }
stop
exit 1
Log.fatal { "Lost cluster leadership" }
exit 3 # 3rd character in the alphabet is C(lustering)
else
@data_dir_lock.try &.poll
GC.collect
Expand Down

0 comments on commit dd15a67

Please sign in to comment.