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


##########
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:
   This identity has only 32 bits of entropy, so two live executor instances 
can legitimately generate the same token. In that case both `ownsJob` checks 
return true for the other's jobs; the non-owner then queries its own in-memory 
map, gets `NoSuchJobException`, and can overwrite the shared job as `FAILED`, 
recreating the multi-node corruption this change is meant to prevent. Use a 
collision-resistant executor identity or coordinate uniqueness instead of 
relying on an 8-hex random value.



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