HOTFIX: Introduce max wait time for retry-and-backoff while creating tasks
Author: Matthias J. Sax
Reviewers: Guozhang Wang
Closes from mjsax/hotfix-backoff-retry
@@ -238,6 +238,7 @@ public class StreamThread extends Thread {
}
abstract class AbstractTaskCreator {
+ final static long MAX_BACKOFF_TIME_MS = 1000L;
void retryWithBackoff(final Map<TaskId, Set<TopicPartition>> tasksToBeCreated, final long start) {
long backoffTimeMs = 50L;
final Set<TaskId> retryingTasks = new HashSet<>();
@@ -272,6 +273,7 @@ public class StreamThread extends Thread {
try {
Thread.sleep(backoffTimeMs);
backoffTimeMs <<= 1;
+ backoffTimeMs = Math.min(backoffTimeMs, MAX_BACKOFF_TIME_MS);
} catch (final InterruptedException e) {
// ignore
}
