Skip to content

Commit

Permalink
Workaround for tests failing due to behavior change in first consumer…
Browse files Browse the repository at this point in the history
… poll
  • Loading branch information
jzakaryan committed Apr 27, 2023
1 parent 39f1008 commit 8dece8d
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -508,7 +508,13 @@ protected void trackEventsProcessedProgress(int recordCount) {
}

protected ConsumerRecords<?, ?> consumerPoll(long pollInterval) {
return _consumer.poll(Duration.ofMillis(pollInterval));
if (pollInterval == 0) {
// Brooklin calls poll with 0 pollInterval when a task is newly initialized. There's a behavior change between old
// and new poll in this case. We need to understand that behavior better before removing usages of deprecated API
return _consumer.poll(pollInterval);
} else {
return _consumer.poll(Duration.ofMillis(pollInterval));
}
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -423,6 +423,10 @@ protected void maybeCommitOffsets(Consumer<?, ?> consumer, boolean hardCommit) {
if (_enablePartitionAssignment && _consumerAssignment.isEmpty()) {
// Kafka rejects a poll if there is empty assignment
return ConsumerRecords.EMPTY;
} else if (pollInterval == 0) {
// BMM calls poll with 0 pollInterval when a task is newly initialized. There's a behavior change between old poll
// and new poll in this case. We need to understand that behavior better before removing usages of deprecated API
return _consumer.poll(pollInterval);
} else {
return _consumer.poll(Duration.ofMillis(pollInterval));
}
Expand Down
2 changes: 1 addition & 1 deletion gradle/maven.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
allprojects {
version = "5.3.0-SNAPSHOT"
version = "5.3.2-SNAPSHOT"
}

subprojects {
Expand Down

0 comments on commit 8dece8d

Please sign in to comment.