Skip to content

Commit

Permalink
Fix Shutdown Race Causing Test Delays
Browse files Browse the repository at this point in the history
Don't poll the consumer if the container has already stopped.
This causes excessive test run times.
Local build time reduced from 7 minutes to less than 5.
  • Loading branch information
garyrussell committed Aug 27, 2020
1 parent 2f048be commit feac8d2
Showing 1 changed file with 3 additions and 0 deletions.
Expand Up @@ -1057,6 +1057,9 @@ protected void pollAndInvoke() {
}
pauseConsumerIfNecessary();
this.lastPoll = System.currentTimeMillis();
if (!isRunning()) {
return;
}
this.polling.set(true);
ConsumerRecords<K, V> records = doPoll();
if (!this.polling.compareAndSet(true, false) && records != null) {
Expand Down

0 comments on commit feac8d2

Please sign in to comment.