-
Notifications
You must be signed in to change notification settings - Fork 14k
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
MINOR: make sure all dir jobs are completed #9728
Conversation
* @param jobs jobs | ||
* @return true if all pass. Otherwise, false | ||
*/ | ||
private[log] def allPass(jobs: Seq[Future[_]]): Boolean = { |
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.
The name makes this look generic, but it's not. The logging is very specific. I would change the name to be specific.
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.
How about "waitForAllToComplete"
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.
The log message talks explicitly about LogManager shutdown. Seems like you'd want it to say something about log manager shutdown. I would even set the type parameter to the type we expect from the shutdown method.
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.
I would even set the type parameter to the type we expect from the shutdown method.
There is no explicit type so I didn't define the type parameter.
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.
LGTM. Thanks for the fix @chia7712 ! I've added a few comments. It will be useful to get this PR into master.
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.
LGTM, thanks for the updated PR!
@ijuma Could you take a look? |
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.
Looks good overall, just a few nits.
def testWaitForAllToComplete(): Unit = { | ||
var invokedCount = 0 | ||
val success: Future[Boolean] = Mockito.mock(classOf[Future[Boolean]]) | ||
Mockito.when(success.get()).thenAnswer(_ => invokedCount += 1) |
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.
Should we not return true
in this answer?
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.
waitForAllToComplete
does not use the return value so it does not cause casting error even though we don't return true
. However, it does look like a bug so I will add the return value.
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.
LGTM, thanks.
revert the change introduced by #9680 and add a unit test to verify
Committer Checklist (excluded from commit message)