jerryshao commented on code in PR #13147:
URL: https://github.com/apache/gravitino/pull/13147#discussion_r4004226033


##########
core/src/main/java/org/apache/gravitino/job/local/LocalJobExecutor.java:
##########
@@ -80,6 +87,9 @@ public class LocalJobExecutor implements JobExecutor {
   @Override
   public void initialize(Map<String, String> configs) {
     this.configs = configs;
+    this.executorId = String.format("%08x", 
ThreadLocalRandom.current().nextInt());

Review Comment:
   Thanks for pointing this out. The executor id only needs to be unique among 
the executor instances that are alive at the same time, which is typically a 
handful of servers. With 32 random bits, the chance of a collision among n live 
instances is about n²/2³³, e.g. ~1e-8 for 10 instances. A collision with an 
instance that has already exited is harmless: the new instance would find the 
job missing and mark it as `FAILED`, which is correct since the job's process 
is already gone. We chose 8 hex digits to keep the job execution ids short, so 
I'd keep it as is.



-- 
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