Skip to content

Commit

Permalink
[server] fix npe in adaptive throttler code (#1456)
Browse files Browse the repository at this point in the history
Co-authored-by: Sourav Maji <[email protected]>
  • Loading branch information
majisourav99 and Sourav Maji authored Jan 17, 2025
1 parent 216474f commit cf814c7
Showing 1 changed file with 7 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -187,12 +187,8 @@ public IngestionThrottler(
this.isUsingSpeedupThrottler = true;
} else if (!hasCurrentVersionBootstrapping && isUsingSpeedupThrottler) {
LOGGER.info("There is no active current version bootstrapping, so switch to regular throttler");
this.finalRecordThrottler = serverConfig.isAdaptiveThrottlerEnabled()
? globalRecordAdaptiveIngestionThrottler
: globalRecordThrottler;
this.finalBandwidthThrottler = serverConfig.isAdaptiveThrottlerEnabled()
? globalBandwidthAdaptiveIngestionThrottler
: globalBandwidthThrottler;
this.finalRecordThrottler = globalRecordThrottler;
this.finalBandwidthThrottler = globalBandwidthThrottler;
this.isUsingSpeedupThrottler = false;
}

Expand All @@ -204,8 +200,11 @@ public IngestionThrottler(
this.eventThrottlerUpdateService = null;
}

this.finalRecordThrottler = globalRecordThrottler;
this.finalBandwidthThrottler = globalBandwidthThrottler;
this.finalRecordThrottler =
serverConfig.isAdaptiveThrottlerEnabled() ? globalRecordAdaptiveIngestionThrottler : globalRecordThrottler;
this.finalBandwidthThrottler = serverConfig.isAdaptiveThrottlerEnabled()
? globalBandwidthAdaptiveIngestionThrottler
: globalBandwidthThrottler;
}

public void maybeThrottleRecordRate(ConsumerPoolType poolType, int count) {
Expand Down

0 comments on commit cf814c7

Please sign in to comment.