Skip to content
Closed
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 @@ -265,22 +265,29 @@ private void runLoop() {
sensors.pollTimeSensor.record(endPoll - startPoll);
}

// try to process one record from each task
totalNumBuffered = 0;
requiresPoll = false;

for (StreamTask task : tasks.values()) {
long startProcess = time.milliseconds();
if (!tasks.isEmpty()) {
// try to process one record from each task
requiresPoll = false;

totalNumBuffered += task.process();
requiresPoll = requiresPoll || task.requiresPoll();
for (StreamTask task : tasks.values()) {
long startProcess = time.milliseconds();

sensors.processTimeSensor.record(time.milliseconds() - startProcess);
totalNumBuffered += task.process();
requiresPoll = requiresPoll || task.requiresPoll();

sensors.processTimeSensor.record(time.milliseconds() - startProcess);
}

maybePunctuate();
maybeCommit();
} else {
// even when no task is assigned, we must poll to get a task.
requiresPoll = true;
}

maybePunctuate();
maybeClean();
maybeCommit();
}
} catch (Exception e) {
throw new KafkaException(e);
Expand Down