Skip to content

Commit

Permalink
Catch error that could cause LeaderScheduler thread to crash (#4850)
Browse files Browse the repository at this point in the history
Signed-off-by: Taylor Gray <tylgry@amazon.com>
  • Loading branch information
graytaylor0 authored Aug 21, 2024
1 parent 923145c commit 292a225
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,11 @@ public void run() {
if(leaderPartition != null) {
// Extend the timeout
// will always be a leader until shutdown
coordinator.saveProgressStateForPartition(leaderPartition, Duration.ofMinutes(DEFAULT_EXTEND_LEASE_MINUTES));
try {
coordinator.saveProgressStateForPartition(leaderPartition, Duration.ofMinutes(DEFAULT_EXTEND_LEASE_MINUTES));
} catch (final Exception e) {
LOG.error("Failed to update ownership for leader partition. Retrying...");
}
}
try {
Thread.sleep(leaseInterval.toMillis());
Expand Down

0 comments on commit 292a225

Please sign in to comment.