Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -348,4 +348,12 @@ internal static partial class LogMessages
EventName = $"{EventIdPrefix}.{nameof(StandbyStateExitedWithError)}"
)]
public static partial void StandbyStateExitedWithError(this ILogger logger, Exception e);

[LoggerMessage(
EventIdOffset + 43,
LogLevel.Critical,
"Transition to standby state has failed",
EventName = $"{EventIdPrefix}.{nameof(TransitionToStandbyStateFailed)}"
)]
public static partial void TransitionToStandbyStateFailed(this ILogger logger, Exception e);
}
Original file line number Diff line number Diff line change
Expand Up @@ -1046,7 +1046,14 @@ async void IRaftStateMachine<TMember>.MoveToFollowerState(IRaftStateMachine.IWea
catch (Exception e)
{
Logger.TransitionToFollowerStateFailed(e);
await MoveToStandbyState().ConfigureAwait(false);
try
{
await MoveToStandbyState().ConfigureAwait(false);
}
catch (Exception fallbackEx)
{
Logger.TransitionToStandbyStateFailed(fallbackEx);
}
}
finally
{
Expand Down Expand Up @@ -1119,7 +1126,14 @@ async void IRaftStateMachine<TMember>.MoveToCandidateState(IRaftStateMachine.IWe
catch (Exception e)
{
Logger.TransitionToCandidateStateFailed(e);
await MoveToStandbyState().ConfigureAwait(false);
try
{
await MoveToStandbyState().ConfigureAwait(false);
}
catch (Exception fallbackEx)
{
Logger.TransitionToStandbyStateFailed(fallbackEx);
}
}
finally
{
Expand Down Expand Up @@ -1176,7 +1190,14 @@ async void IRaftStateMachine<TMember>.MoveToLeaderState(IRaftStateMachine.IWeakC
catch (Exception e)
{
Logger.TransitionToLeaderStateFailed(e);
await MoveToStandbyState().ConfigureAwait(false);
try
{
await MoveToStandbyState().ConfigureAwait(false);
}
catch (Exception fallbackEx)
{
Logger.TransitionToStandbyStateFailed(fallbackEx);
}
}
finally
{
Expand Down