MINOR: KAFKA-2371 follow-up, DistributedHerder should wakeup WorkerGroupMember after assignment to ensure work is started immediately

Author: Ewen Cheslack-Postava <me@ewencp.org>

Reviewers: Gwen Shapira

Closes #360 from ewencp/minor-kafka-2371-follow-up-wakeup-after-rebalance
This commit is contained in:
Ewen Cheslack-Postava 2015-10-28 12:42:03 -07:00 committed by Gwen Shapira
parent 9855bb9c65
commit 8838fa8010
2 changed files with 6 additions and 0 deletions

View File

@ -614,6 +614,10 @@ public class DistributedHerder implements Herder, Runnable {
log.info("Joined group and got assignment: {}", assignment);
DistributedHerder.this.assignment = assignment;
rebalanceResolved = false;
// We *must* interrupt any poll() call since this could occur when the poll starts, and we might then
// sleep in the poll() for a long time. Forcing a wakeup ensures we'll get to process this event in the
// main thread.
member.wakeup();
}
@Override

View File

@ -371,6 +371,8 @@ public class DistributedHerderTest {
return null;
}
});
member.wakeup();
PowerMock.expectLastCall();
}
private void expectPostRebalanceCatchup(final ClusterConfigState readToEndSnapshot) {