Improve logging in CoordinatorBasedSegmentHandoffNotifier#14640
Conversation
abhishekrb19
left a comment
There was a problem hiding this comment.
Good catch, @aho135. Thank you for the contribution!
Minor suggestions - ISO 8601 duration is a bit friendlier to read than raw milliseconds
| log.error( | ||
| e, | ||
| "Exception while checking handoff for dataSource[%s] Segment[%s], Will try again after [%d]secs", | ||
| "Exception while checking handoff for dataSource[%s] Segment[%s], Will try again after [%d]ms", |
There was a problem hiding this comment.
| "Exception while checking handoff for dataSource[%s] Segment[%s], Will try again after [%d]ms", | |
| "Exception while checking handoff for datasource[%s] segment[%s]; will try again after [%s]", |
| "Exception while checking handoff for dataSource[%s] Segment[%s], Will try again after [%d]ms", | ||
| dataSource, | ||
| descriptor, | ||
| pollDurationMillis |
There was a problem hiding this comment.
| pollDurationMillis | |
| new Duration(pollDurationMillis).toString() |
| log.error( | ||
| t, | ||
| "Exception while checking handoff for dataSource[%s], Will try again after [%d]secs", | ||
| "Exception while checking handoff for dataSource[%s], Will try again after [%d]ms", |
There was a problem hiding this comment.
| "Exception while checking handoff for dataSource[%s], Will try again after [%d]ms", | |
| "Exception while checking handoff for datasource[%s]; will try again after [%s]", |
There was a problem hiding this comment.
Thanks for the review @abhishekrb19 Just pushed an update
| dataSource, | ||
| descriptor, | ||
| pollDurationMillis | ||
| Duration.ofMillis(pollDurationMillis).toString() |
There was a problem hiding this comment.
We might as well just change the field long pollDurationMillis to be Duration pollDuration instead. The constructor already takes a Duration. We could also use ScheduledExecutors.scheduleAtFixedRate in line 75 for a Duration friendly invocation.
kfaraz
left a comment
There was a problem hiding this comment.
Minor comment, otherwise looks good.
| dataSource, | ||
| descriptor, | ||
| pollDurationMillis | ||
| pollDuration.toString() |
There was a problem hiding this comment.
You can just use pollDuration instead of pollDuration.toString() here as the .toString() is implicit.
| "Exception while checking handoff for dataSource[%s]; will try again after [%s]", | ||
| dataSource, | ||
| pollDurationMillis | ||
| pollDuration.toString() |
|
|
||
| import org.joda.time.Duration; |
There was a problem hiding this comment.
| import org.joda.time.Duration; | |
| import org.joda.time.Duration; | |
There was a problem hiding this comment.
this is causing checkstyle to fail.
There was a problem hiding this comment.
Thanks for the review @kfaraz! Just pushed this fix
Description
Fixes time unit for Segment Handoff log from seconds to milliseconds
Changed secs to ms for time unit in CoordinatorBasedSegmentHandoffNotifier
Fixed the bug ...
Renamed the class ...
Added a forbidden-apis entry ...
Release note
Key changed/added classes in this PR
CoordinatorBasedSegmentHandoffNotifier
This PR has: