Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -548,6 +548,7 @@ public void run() {
failedStreamThreadSensor.record();
requestLeaveGroupDuringShutdown();
streamsUncaughtExceptionHandler.accept(e, false);
// Note: the above call currently rethrows the exception, so nothing below this line will be executed
} finally {
completeShutdown(cleanRun);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@
* shared between all StreamThreads.
*/
public class TaskExecutionMetadata {
// TODO: implement exponential backoff, for now we just wait 5s
private static final long CONSTANT_BACKOFF_MS = 5_000L;

private final boolean hasNamedTopologies;
// map of topologies experiencing errors/currently under backoff
private final ConcurrentHashMap<String, NamedTopologyMetadata> topologyNameToErrorMetadata = new ConcurrentHashMap<>();
Expand Down Expand Up @@ -58,7 +61,7 @@ public void registerTaskError(final Task task, final Throwable t, final long now
}
}

class NamedTopologyMetadata {
private class NamedTopologyMetadata {
private final Logger log;
private final Map<TaskId, Long> tasksToErrorTime = new ConcurrentHashMap<>();

Expand All @@ -73,11 +76,10 @@ public boolean canProcess() {
}

public boolean canProcessTask(final Task task, final long now) {
// TODO: implement exponential backoff, for now we just wait 15s
final Long errorTime = tasksToErrorTime.get(task.id());
if (errorTime == null) {
return true;
} else if (now - errorTime > 15000L) {
} else if (now - errorTime > CONSTANT_BACKOFF_MS) {
log.info("End backoff for task {} at t={}", task.id(), now);
tasksToErrorTime.remove(task.id());
if (tasksToErrorTime.isEmpty()) {
Expand Down

This file was deleted.

This file was deleted.

Loading