Skip to content

TEZ-4737: Session DAG submission fails with FileAlreadyExistsException when the session outlives the TezClient - #523

Merged
abstractdog merged 2 commits into
apache:masterfrom
deniskuzZ:TEZ-4737
Jul 18, 2026
Merged

TEZ-4737: Session DAG submission fails with FileAlreadyExistsException when the session outlives the TezClient#523
abstractdog merged 2 commits into
apache:masterfrom
deniskuzZ:TEZ-4737

Conversation

@deniskuzZ

@deniskuzZdeniskuzZ commented Jul 15, 2026

Copy link
Copy Markdown
Member

The serialized DAG plan file (tez-dag.pb) written for plans exceeding the IPC limit is named by a per-TezClient counter and never deleted. When the session and its staging directory outlive the TezClient instances, a new client generation recomputes the same file name and fails with FileAlreadyExistsException, permanently blocking oversized submissions on that session.

Create the plan file with overwrite=true (a file at that path can only be an already consumed leftover), and delete it in the AM once the submitDAG request has been parsed.

Reproduced by the new unit test: TestTezClient#testSessionLargeDAGPlanWithLeftoverPlanFile:

org.apache.hadoop.fs.FileAlreadyExistsException: File already exists: file:/.../tez-api/target/tmp/org.apache.tez.client.TestTezClient/.tez/application_0_0001/tez-dag.pb1 at org.apache.hadoop.fs.RawLocalFileSystem.create(RawLocalFileSystem.java:622) at org.apache.hadoop.fs.RawLocalFileSystem.create(RawLocalFileSystem.java:660) at org.apache.hadoop.fs.ChecksumFileSystem$ChecksumFSOutputSummer.<init>(ChecksumFileSystem.java:692) at org.apache.hadoop.fs.ChecksumFileSystem.create(ChecksumFileSystem.java:780) at org.apache.hadoop.fs.ChecksumFileSystem.create(ChecksumFileSystem.java:759) at org.apache.hadoop.fs.FileSystem.create(FileSystem.java:1234) at org.apache.hadoop.fs.FileSystem.create(FileSystem.java:1211) at org.apache.hadoop.fs.FileSystem.create(FileSystem.java:1092) at org.apache.tez.client.TezClient.submitDAGSession(TezClient.java:695) at org.apache.tez.client.TezClient.submitDAG(TezClient.java:614) at org.apache.tez.client.TestTezClient.testSessionLargeDAGPlanWithLeftoverPlanFile(TestTezClient.java:328) 

@tez-yetus

Copy link
Copy Markdown

🎊 +1 overall

VoteSubsystemRuntimeLogfileComment
+0 🆗reexec0m 30sDocker mode activated.
_ Prechecks _
+1 💚dupname0m 0sNo case conflicting files found.
+0 🆗detsecrets0m 0sdetect-secrets was not available.
+1 💚@author0m 0sThe patch does not contain any @author tags.
+1 💚test4tests0m 0sThe patch appears to include 2 new or modified test files.
_ master Compile Tests _
+0 🆗mvndep0m 33sMaven dependency ordering for branch
+1 💚mvninstall4m 49smaster passed
+1 💚compile3m 57smaster passed
+1 💚checkstyle1m 10smaster passed
+1 💚javadoc1m 10smaster passed
+0 🆗spotbugs1m 24stez-api in master has 92 extant spotbugs warnings.
+0 🆗spotbugs1m 43stez-dag in master has 537 extant spotbugs warnings.
_ Patch Compile Tests _
+0 🆗mvndep0m 9sMaven dependency ordering for patch
+1 💚mvninstall4m 1sthe patch passed
+1 💚codespell1m 48sNo new issues.
+1 💚compile3m 57sthe patch passed
+1 💚javac3m 57sthe patch passed
+1 💚blanks0m 0sThe patch has no blanks issues.
+1 💚checkstyle1m 4sthe patch passed
+1 💚javadoc1m 9sthe patch passed
+1 💚spotbugs3m 32sthe patch passed
_ Other Tests _
+1 💚unit72m 43sroot in the patch passed.
+1 💚asflicense0m 59sThe patch does not generate ASF License warnings.
106m 47s
SubsystemReport/Notes
DockerClientAPI=1.55 ServerAPI=1.55 base: https://ci-hadoop.apache.org/job/tez-multibranch/job/PR-523/1/artifact/out/Dockerfile
Optional Testsdupname compile unit asflicense javac javadoc spotbugs checkstyle codespell detsecrets
unameLinux 84a506d533d2 5.15.0-185-generic #195-Ubuntu SMP Fri Jun 19 17:11:50 UTC 2026 x86_64 x86_64 x86_64 GNU/Linux
Build toolmaven
Personalitytez-personality.sh
git revisionmaster / 4bccf3a
Default JavaEclipse Adoptium-21.0.11+10-LTS
Test Resultshttps://ci-hadoop.apache.org/job/tez-multibranch/job/PR-523/1/testReport/
Max. process+thread count1477 (vs. ulimit of 5500)
modulesC: tez-api tez-dag U: .
Console outputhttps://ci-hadoop.apache.org/job/tez-multibranch/job/PR-523/1/console
versionsgit=2.43.0 maven=3.9.15 spotbugs=4.9.3 codespell=2.4.1
Powered byApache Yetus 0.15.1 https://yetus.apache.org

This message was automatically generated.

@abstractdogabstractdog left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for the fix @deniskuzZ so far, left minor comments

Comment threadtez-api/src/main/java/org/apache/tez/client/TezClient.java Outdated
Comment threadtez-api/src/test/java/org/apache/tez/client/TestTezClient.java Outdated
Comment threadtez-api/src/test/java/org/apache/tez/client/TestTezClient.java Outdated
Comment threadtez-api/src/test/java/org/apache/tez/client/TestTezClient.java Outdated
Comment threadtez-api/src/main/java/org/apache/tez/client/TezClient.java Outdated

@abstractdogabstractdog left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@abstractdog
abstractdog merged commit b9d8c0f into apache:masterJul 18, 2026
6 checks passed
@deniskuzZ

Copy link
Copy Markdown
MemberAuthor

thank you, @abstractdog !

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

@deniskuzZ@tez-yetus@abstractdog