Fix undefined behaviour in GlobalTagThrottler::get*Rates functions

This commit is contained in:
sfc-gh-tclinkenbeard 2022-08-18 17:31:38 -07:00
parent ae1fc191f1
commit 489b62c29e
1 changed files with 2 additions and 2 deletions

View File

@ -445,7 +445,7 @@ public:
for (auto& [tag, stats] : tagStatistics) {
// Currently there is no differentiation between batch priority and default priority transactions
TraceEvent te("GlobalTagThrottler_GotRate", id);
bool isReadBusy, isWriteBusy;
bool isReadBusy = false, isWriteBusy = false;
auto const targetTps = getTargetTps(tag, isReadBusy, isWriteBusy, te);
if (isReadBusy) {
++lastBusyReadTagCount;
@ -472,7 +472,7 @@ public:
for (auto& [tag, stats] : tagStatistics) {
// Currently there is no differentiation between batch priority and default priority transactions
bool isReadBusy, isWriteBusy;
bool isReadBusy = false, isWriteBusy = false;
TraceEvent te("GlobalTagThrottler_GotClientRate", id);
auto const targetTps = getTargetTps(tag, isReadBusy, isWriteBusy, te);