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 @@ -290,6 +290,8 @@ public boolean commitOffsets() {
finishSuccessfulFlush();
log.debug("Finished {} offset commitOffsets successfully in {} ms",
this, time.milliseconds() - started);

commitSourceTask();
return true;
}
}
Expand Down Expand Up @@ -334,9 +336,22 @@ public void onCompletion(Throwable error, Void result) {
finishSuccessfulFlush();
log.info("Finished {} commitOffsets successfully in {} ms",
this, time.milliseconds() - started);

commitSourceTask();

return true;
}

private void commitSourceTask() {
try {
this.task.commit();
} catch (InterruptedException ex) {
log.warn("Commit interrupted", ex);
} catch (Throwable ex) {
log.error("Exception thrown while calling task.commit()", ex);
}
}

private synchronized void finishFailedFlush() {
offsetWriter.cancelFlush();
outstandingMessages.putAll(outstandingMessagesBacklog);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,8 @@ public void testCommit() throws Exception {
final CountDownLatch pollLatch = expectPolls(1);
expectOffsetFlush(true);

sourceTask.commit();
EasyMock.expectLastCall();
sourceTask.stop();
EasyMock.expectLastCall();
expectOffsetFlush(true);
Expand Down