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 committed Dec 12, 2024
1 parent 045c16a commit 5faa7f1
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 5faa7f1

Please sign in to comment.