Skip to content

TEZ-4739: Improve ACLManager - #524

Merged
abstractdog merged 3 commits into
apache:masterfrom
abstractdog:TEZ-4739
Jul 28, 2026
Merged

TEZ-4739: Improve ACLManager#524
abstractdog merged 3 commits into
apache:masterfrom
abstractdog:TEZ-4739

Conversation

@abstractdog

Copy link
Copy Markdown
Contributor

No description provided.

return;
}
if (aclInfo == null) {
return;

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.

nit:

if (!aclsEnabled || aclInfo == null) {
return;
}

@Aggarwal-RaghavAggarwal-Raghav 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 +1

@Aggarwal-RaghavAggarwal-Raghav 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 +1

@tez-yetus

This comment was marked as outdated.

@tez-yetus

Copy link
Copy Markdown

🎊 +1 overall

VoteSubsystemRuntimeLogfileComment
+0 🆗reexec3m 51sDocker 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 1 new or modified test files.
_ master Compile Tests _
+1 💚mvninstall3m 4smaster passed
+1 💚compile2m 34smaster passed
+1 💚checkstyle0m 24smaster passed
+1 💚javadoc0m 26smaster passed
+0 🆗spotbugs0m 49stez-api in master has 92 extant spotbugs warnings.
_ Patch Compile Tests _
+1 💚mvninstall2m 15sthe patch passed
+1 💚codespell0m 50sNo new issues.
+1 💚compile2m 36sthe patch passed
+1 💚javac2m 36sthe patch passed
+1 💚blanks0m 0sThe patch has no blanks issues.
+1 💚checkstyle0m 18sthe patch passed
+1 💚javadoc0m 28sthe patch passed
+1 💚spotbugs0m 57sthe patch passed
_ Other Tests _
+1 💚unit59m 24sroot in the patch passed.
+1 💚asflicense0m 22sThe patch does not generate ASF License warnings.
79m 19s
SubsystemReport/Notes
DockerClientAPI=1.55 ServerAPI=1.55 base: https://ci-hadoop.apache.org/job/tez-multibranch/job/PR-524/2/artifact/out/Dockerfile
Optional Testsdupname compile unit asflicense javac javadoc spotbugs checkstyle codespell detsecrets
unameLinux d03c04e47a51 5.15.0-179-generic #189-Ubuntu SMP Tue May 5 18:20:56 UTC 2026 x86_64 x86_64 x86_64 GNU/Linux
Build toolmaven
Personalitytez-personality.sh
git revisionmaster / b9d8c0f
Default JavaEclipse Adoptium-21.0.11+10-LTS
Test Resultshttps://ci-hadoop.apache.org/job/tez-multibranch/job/PR-524/2/testReport/
Max. process+thread count1525 (vs. ulimit of 5500)
modulesC: tez-api U: tez-api
Console outputhttps://ci-hadoop.apache.org/job/tez-multibranch/job/PR-524/2/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.

Comment on lines +80 to +81
this.users = new HashMap<>(amACLManager.users);
this.groups = new HashMap<>(amACLManager.groups);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think this is a Shallow Copy not a Deep Copy? Is it intentional? Though we are doing put here below. But if someone does in future .get(key).add(...) it might lead to some problems, can you check once

something like in future this.users.get(ACLType.AM_VIEW_ACL).add("new_user") inside this class, it will silently modify the global Application Master's ACLs. They might think they are only granting a user access to a specific DAG, but because of the shallow copy, they would accidentally be granting that user global AM access.

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

thanks @ayushtkn, that's absolutely valid, fixed in 6142f4b

The per-DAG ACLManager constructor previously did new HashMap<>(amACLManager.users)
and new HashMap<>(amACLManager.groups), which is a shallow copy: the outer map is
new, but each Set<String> value is still shared with the AM manager. Today only
put(...) is used on those maps, so no leak occurs in practice — but any future
this.users.get(ACLType.AM_VIEW_ACL).add(user) inside this class would silently
mutate the AM's global ACLs and every sibling DAG's view of them.
Deep-copy each inner Set on construction, and add a reflection-based regression
test that mutates the DAG manager's set in place and asserts the AM manager is
untouched — verified to fail against the shallow-copy version.
@tez-yetus

Copy link
Copy Markdown

🎊 +1 overall

VoteSubsystemRuntimeLogfileComment
+0 🆗reexec0m 8sDocker 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 1 new or modified test files.
_ master Compile Tests _
+1 💚mvninstall3m 18smaster passed
+1 💚compile2m 43smaster passed
+1 💚checkstyle0m 24smaster passed
+1 💚javadoc0m 30smaster passed
+0 🆗spotbugs0m 56stez-api in master has 92 extant spotbugs warnings.
_ Patch Compile Tests _
+1 💚mvninstall2m 39sthe patch passed
+1 💚codespell1m 8sNo new issues.
+1 💚compile2m 48sthe patch passed
+1 💚javac2m 48sthe patch passed
+1 💚blanks0m 0sThe patch has no blanks issues.
+1 💚checkstyle0m 17sthe patch passed
+1 💚javadoc0m 25sthe patch passed
+1 💚spotbugs1m 5sthe patch passed
_ Other Tests _
+1 💚unit62m 17sroot in the patch passed.
+1 💚asflicense0m 20sThe patch does not generate ASF License warnings.
80m 1s
SubsystemReport/Notes
DockerClientAPI=1.55 ServerAPI=1.55 base: https://ci-hadoop.apache.org/job/tez-multibranch/job/PR-524/3/artifact/out/Dockerfile
Optional Testsdupname compile unit asflicense javac javadoc spotbugs checkstyle codespell detsecrets
unameLinux b2aa0f1700d0 5.15.0-179-generic #189-Ubuntu SMP Tue May 5 18:20:56 UTC 2026 x86_64 x86_64 x86_64 GNU/Linux
Build toolmaven
Personalitytez-personality.sh
git revisionmaster / 74bb821
Default JavaEclipse Adoptium-21.0.11+10-LTS
Test Resultshttps://ci-hadoop.apache.org/job/tez-multibranch/job/PR-524/3/testReport/
Max. process+thread count1959 (vs. ulimit of 5500)
modulesC: tez-api U: tez-api
Console outputhttps://ci-hadoop.apache.org/job/tez-multibranch/job/PR-524/3/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.

@ayushtknayushtkn left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanx @abstractdog for the fix, Sorry for the delay got pulled into other stuff and this kept on slipping

Changes LGTM

@abstractdog
abstractdog merged commit 84e634a into apache:masterJul 28, 2026
6 checks passed
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.

4 participants

@abstractdog@tez-yetus@ayushtkn@Aggarwal-Raghav