mdedetrich commented on code in PR #12044:
URL: https://github.com/apache/kafka/pull/12044#discussion_r852823850


##########
streams/src/main/java/org/apache/kafka/streams/processor/internals/TaskScheduler.java:
##########
@@ -0,0 +1,161 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.kafka.streams.processor.internals;
+
+import org.apache.kafka.common.utils.ExponentialBackoff;
+import org.apache.kafka.common.utils.LogContext;
+import org.apache.kafka.streams.processor.TaskId;
+
+import java.util.Map;
+import java.util.Set;
+import java.util.concurrent.ConcurrentHashMap;
+import org.slf4j.Logger;
+
+import static 
org.apache.kafka.streams.processor.internals.TopologyMetadata.UNNAMED_TOPOLOGY;
+
+/**
+ * Multi-threaded class that tracks the status of active tasks being processed 
and decides if/when they can
+ * be executed.
+ *
+ * Note: A single instance of this class is shared between all StreamThreads, 
so it must be thread-safe
+ */
+public class TaskScheduler {
+    // Reaches the maximum backoff interval in about 5 attempts, at which point
+    private static final long INITIAL_BACKOFF_MS = 3 * 1000L;  // wait 3s 
after the first task failure

Review Comment:
   Does it make sense to have these values configurable with the defaults being 
what you hardcoded? Even if its not configurable but `TaskScheduler` is given a 
constructor containing 
`INITIAL_BACKOFF_MS`/`RETRY_BACKOFF_EXP_BASE`/`MAXIMUM_BACKOFF_MS`/`RETRY_BACKOFF_JITTER`
 as parameters.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to