laserninja opened a new issue, #13158: URL: https://github.com/apache/gravitino/issues/13158
### Version main branch (reproduced at 5a9ee9aba; relevant code checked against upstream 9d6a881698) ### Describe what's wrong Different artifact URIs with the same basename resolve to the same staging path. A later auxiliary script can overwrite the executable, causing the job to run different code than requested. ### Error message and/or stacktrace ```text COLLISION PROCESS EXIT: 0 COLLISION EXECUTABLE EXPECTED FIRST, ACTUAL: SECOND ``` ### How to reproduce Create `first/task.sh` containing `#!/bin/sh\necho FIRST\n` and `second/task.sh` containing `#!/bin/sh\necho SECOND\n` (use actual newlines). Build a ShellJobTemplate with the first file URI as executable and the second file URI in scripts. Prepare it using `JobManager.createRuntimeJobTemplate`, then run it with `LocalProcessBuilder.create(runtime, Map.of()).start()`. After the process finishes, its staging directory `output.log` contains SECOND. Expected: execute FIRST, or reject the conflicting artifacts before execution. Two auxiliary scripts with identical basenames also collapse to the same path and content. ### Additional context `fetchFileFromUri` uses only the basename for destination paths, and local staging replaces existing links. Detect conflicting source URIs before staging or use collision-free destinations with consistent runtime references. Cover executable/script and cross-artifact collisions. PR #8813 adds filesystem schemes but retains basename staging. Source: `core/src/main/java/org/apache/gravitino/job/JobManager.java:938`. -- 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]
