Skip to content
Merged
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 @@ -1042,15 +1042,15 @@ private boolean maybePunctuate() {
* or if the task producer got fenced (EOS)
*/
boolean maybeCommit() {
int committed = 0;
final int committed;

if (now - lastCommitMs > commitTimeMs) {
if (log.isTraceEnabled()) {
log.trace("Committing all active tasks {} and standby tasks {} since {}ms has elapsed (commit interval is {}ms)",
taskManager.activeTaskIds(), taskManager.standbyTaskIds(), now - lastCommitMs, commitTimeMs);
}

committed += taskManager.commitAll();
committed = taskManager.commitAll();
if (committed > 0) {
final long intervalCommitLatency = advanceNowAndComputeLatency();
commitSensor.record(intervalCommitLatency / (double) committed, now);
Expand All @@ -1067,11 +1067,10 @@ boolean maybeCommit() {
lastCommitMs = now;
processStandbyRecords = true;
} else {
final int commitPerRequested = taskManager.maybeCommitActiveTasksPerUserRequested();
if (commitPerRequested > 0) {
committed = taskManager.maybeCommitActiveTasksPerUserRequested();
if (committed > 0) {
final long requestCommitLatency = advanceNowAndComputeLatency();
commitSensor.record(requestCommitLatency / (double) committed, now);

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The problem was here: committed could be zero without this fix.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems like this should have noticeably screwed up these metrics, do we think this branch is just rarely seen or no one has noticed somehow?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's rarely executed. Only if a PAPI user request committing via context.commit(), what is expected to be rarely used feature.

committed += commitPerRequested;
}
}

Expand Down