-
Notifications
You must be signed in to change notification settings - Fork 602
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: log details of cancelled transitions #11069
Conversation
When one transition cancels another, we were only logging a generic "cancel" message. This was lacking context, specifically which transition causes a cancellation. Here we add a `toString` implementation for `PartitionTransitionProcess` that shows term, role, status and the remaining steps. This is used in a new log statement that should provide us with the necessary context.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@oleschoenburg Thanks for improving the logs. Please apply my comment. There is no need for another review as it is a minor change.
@@ -109,6 +109,9 @@ private void enqueueNextTransition( | |||
ongoingTransitionFuture = currentTransitionFuture; | |||
|
|||
final var ongoingTransition = currentTransition; | |||
|
|||
LOG.info( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
❌ This will be logged everytime there is transition. Previous transition needs to be cancelled only if it was not completed. So you should log only if !ongoingTransition.isCompleted()
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh nice catch! I didn't realize that currentTransition
is not cleared when it is completed 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
May be it is better to clear currentTransition
after it is completed. Not sure if it causes other issues.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's tricky to do this correctly. By the time a transition finishes, the currentTransition
might be a newer transition so we shouldn't just set it to null.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I'd rather not touch that right now so I only added a check so that we only log if the "current" transition is not completed, like you suggested.
bors r+ |
11069: feat: log details of cancelled transitions r=oleschoenburg a=oleschoenburg When one transition cancels another, we were only logging a generic "cancel" message. This was lacking context, specifically which transition causes a cancellation. Here we add a `toString` implementation for `PartitionTransitionProcess` that shows term, role, status and the remaining steps. This is used in a new log statement that should provide us with the necessary context. Co-authored-by: Ole Schönburg <ole.schoenburg@gmail.com>
Build failed: |
Failed due to #11072 bors r+ |
11069: feat: log details of cancelled transitions r=oleschoenburg a=oleschoenburg When one transition cancels another, we were only logging a generic "cancel" message. This was lacking context, specifically which transition causes a cancellation. Here we add a `toString` implementation for `PartitionTransitionProcess` that shows term, role, status and the remaining steps. This is used in a new log statement that should provide us with the necessary context. Co-authored-by: Ole Schönburg <ole.schoenburg@gmail.com>
Build failed: |
bors retry |
11069: feat: log details of cancelled transitions r=oleschoenburg a=oleschoenburg When one transition cancels another, we were only logging a generic "cancel" message. This was lacking context, specifically which transition causes a cancellation. Here we add a `toString` implementation for `PartitionTransitionProcess` that shows term, role, status and the remaining steps. This is used in a new log statement that should provide us with the necessary context. Co-authored-by: Ole Schönburg <ole.schoenburg@gmail.com>
Build failed: |
bors retry |
11069: feat: log details of cancelled transitions r=oleschoenburg a=oleschoenburg When one transition cancels another, we were only logging a generic "cancel" message. This was lacking context, specifically which transition causes a cancellation. Here we add a `toString` implementation for `PartitionTransitionProcess` that shows term, role, status and the remaining steps. This is used in a new log statement that should provide us with the necessary context. Co-authored-by: Ole Schönburg <ole.schoenburg@gmail.com>
Build failed: |
bors r+ |
Build succeeded: |
Successfully created backport PR #11084 for |
Successfully created backport PR #11085 for |
When one transition cancels another, we were only logging a generic "cancel" message. This was lacking context, specifically which transition causes a cancellation.
Here we add a
toString
implementation forPartitionTransitionProcess
that shows term, role, status and the remaining steps. This is used in a new log statement that should provide us with the necessary context.