Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix indis dual-read lix switch issue #964

Merged
merged 5 commits into from
Jan 3, 2024
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
resolve comments
brycezhongqing committed Jan 3, 2024
commit 1bde9b1177ec697d451995a24b51d266011fc94b
Original file line number Diff line number Diff line change
@@ -188,16 +188,14 @@ public void checkAndSwitchMode(String d2ServiceName)
LOG.info("Dual read mode executor is shut down already. Skipping getting the latest dual read mode.");
return;
}

if (d2ServiceName == null)
{
return;
}
_executorService.execute(() ->
{
if(d2ServiceName == null){
return;
}
RateLimiter serviceRateLimiter = _serviceToRateLimiterMap.computeIfAbsent(
d2ServiceName,
key -> RateLimiter.create((double) 1 / DUAL_READ_MODE_SWITCH_MIN_INTERVAL)
);
RateLimiter serviceRateLimiter = _serviceToRateLimiterMap.computeIfAbsent(d2ServiceName,
key -> RateLimiter.create((double) 1 / DUAL_READ_MODE_SWITCH_MIN_INTERVAL));
boolean shouldCheck = serviceRateLimiter.tryAcquire();
if (shouldCheck)
{