Skip to content

Commit

Permalink
Add thread prefix for StreamingDataflowWorker work executor
Browse files Browse the repository at this point in the history
  • Loading branch information
scwhittle committed Dec 30, 2022
1 parent f1fcf0a commit db1f9d2
Showing 1 changed file with 5 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -667,11 +667,7 @@ public static StreamingDataflowWorker fromDataflowWorkerHarnessOptions(
this.isDoneFuture = new CompletableFuture<>();

this.threadFactory =
r -> {
Thread t = new Thread(r);
t.setDaemon(true);
return t;
};
new ThreadFactoryBuilder().setNameFormat("DataflowWorkUnits-%d").setDaemon(true).build();
this.workUnitExecutor =
new BoundedQueueExecutor(
chooseMaximumNumberOfThreads(),
Expand All @@ -691,7 +687,7 @@ public static StreamingDataflowWorker fromDataflowWorkerHarnessOptions(
memoryMonitorThread.setName("MemoryMonitor");

dispatchThread =
threadFactory.newThread(
new Thread(
new Runnable() {
@Override
public void run() {
Expand All @@ -704,11 +700,12 @@ public void run() {
LOG.info("Dispatch done");
}
});
dispatchThread.setDaemon(true);
dispatchThread.setPriority(Thread.MIN_PRIORITY);
dispatchThread.setName("DispatchThread");

commitThread =
threadFactory.newThread(
new Thread(
new Runnable() {
@Override
public void run() {
Expand All @@ -719,6 +716,7 @@ public void run() {
}
}
});
commitThread.setDaemon(true);
commitThread.setPriority(Thread.MAX_PRIORITY);
commitThread.setName("CommitThread");

Expand Down

0 comments on commit db1f9d2

Please sign in to comment.