Skip to content

TEZ-4527: Add generic and pluggable hooks for DAGs and task attempts - #324

Merged
abstractdog merged 8 commits into
apache:masterfrom
okumin:TEZ-4527-hook
Dec 22, 2024
Merged

TEZ-4527: Add generic and pluggable hooks for DAGs and task attempts#324
abstractdog merged 8 commits into
apache:masterfrom
okumin:TEZ-4527-hook

Conversation

@okumin

Copy link
Copy Markdown
Contributor

@okuminokumin changed the title TEZ-4527: Add generic and pluggable hooks for DAGs and task attempts[WIP] TEZ-4527: Add generic and pluggable hooks for DAGs and task attemptsDec 18, 2023
@okuminokumin changed the title [WIP] TEZ-4527: Add generic and pluggable hooks for DAGs and task attemptsTEZ-4527: Add generic and pluggable hooks for DAGs and task attemptsDec 18, 2023
@okumin
okumin marked this pull request as ready for review December 18, 2023 12:43
@tez-yetus

This comment was marked as outdated.

@ConfigurationProperty
public static final String TEZ_THREAD_DUMP_INTERVAL = "tez.thread.dump.interval";
public static final String TEZ_THREAD_DUMP_INTERVAL_DEFAULT = "0ms";
public static final String TEZ_THREAD_DUMP_INTERVAL_DEFAULT = "100ms";

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.

If we introduce pluggable hooks, I think we can change the default value. We may remove NOOP_TEZ_THREAD_DUMP_HELPER, too.

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.

makes sense
I think for package clarity's sake, all the hook related configs can go a namespace that implies they're hooks:

tez.hook.thread.dump.internal

also:

TEZ_HOOK_THREAD_DUMP_INTERVAL

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.

I think you can remove the NoopTezThreadDumpHelper

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.

@tez-yetus

This comment was marked as outdated.

@tez-yetus

Copy link
Copy Markdown

💔 -1 overall

VoteSubsystemRuntimeComment
+0 🆗reexec0m 30sDocker mode activated.
_ Prechecks _
+1 💚dupname0m 1sNo case conflicting files found.
+1 💚@author0m 0sThe patch does not contain any @author tags.
-1 ❌test4tests0m 0sThe patch doesn't appear to include any new or modified tests. Please justify why no new tests are needed for this patch. Also please list what manual steps were performed to verify this patch.
_ master Compile Tests _
+0 🆗mvndep6m 12sMaven dependency ordering for branch
+1 💚mvninstall12m 13smaster passed
+1 💚compile2m 11smaster passed with JDK Ubuntu-11.0.21+9-post-Ubuntu-0ubuntu122.04
+1 💚compile2m 2smaster passed with JDK Private Build-1.8.0_392-8u392-ga-1~22.04-b08
+1 💚checkstyle2m 3smaster passed
+1 💚javadoc1m 51smaster passed with JDK Ubuntu-11.0.21+9-post-Ubuntu-0ubuntu122.04
+1 💚javadoc1m 38smaster passed with JDK Private Build-1.8.0_392-8u392-ga-1~22.04-b08
+0 🆗spotbugs1m 19sUsed deprecated FindBugs config; considering switching to SpotBugs.
+1 💚findbugs4m 16smaster passed
_ Patch Compile Tests _
+0 🆗mvndep0m 10sMaven dependency ordering for patch
+1 💚mvninstall1m 20sthe patch passed
+1 💚compile1m 26sthe patch passed with JDK Ubuntu-11.0.21+9-post-Ubuntu-0ubuntu122.04
+1 💚javac1m 26sthe patch passed
+1 💚compile1m 15sthe patch passed with JDK Private Build-1.8.0_392-8u392-ga-1~22.04-b08
+1 💚javac1m 15sthe patch passed
+1 💚checkstyle0m 51sthe patch passed
+1 💚whitespace0m 0sThe patch has no whitespace issues.
+1 💚javadoc0m 52sthe patch passed with JDK Ubuntu-11.0.21+9-post-Ubuntu-0ubuntu122.04
+1 💚javadoc0m 52sthe patch passed with JDK Private Build-1.8.0_392-8u392-ga-1~22.04-b08
+1 💚findbugs3m 36sthe patch passed
_ Other Tests _
+1 💚unit2m 16stez-api in the patch passed.
+1 💚unit0m 25stez-common in the patch passed.
+1 💚unit0m 38stez-runtime-internals in the patch passed.
+1 💚unit4m 55stez-dag in the patch passed.
+1 💚asflicense0m 39sThe patch does not generate ASF License warnings.
53m 56s
SubsystemReport/Notes
DockerClientAPI=1.43 ServerAPI=1.43 base: https://ci-hadoop.apache.org/job/tez-multibranch/job/PR-324/3/artifact/out/Dockerfile
GITHUB PR#324
JIRA IssueTEZ-4527
Optional Testsdupname asflicense javac javadoc unit spotbugs findbugs checkstyle compile
unameLinux c3ccbb36f8b9 5.15.0-88-generic #98-Ubuntu SMP Mon Oct 2 15:18:56 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux
Build toolmaven
Personalitypersonality/tez.sh
git revisionmaster / 0c5cf68
Default JavaPrivate Build-1.8.0_392-8u392-ga-1~22.04-b08
Multi-JDK versions/usr/lib/jvm/java-11-openjdk-amd64:Ubuntu-11.0.21+9-post-Ubuntu-0ubuntu122.04 /usr/lib/jvm/java-8-openjdk-amd64:Private Build-1.8.0_392-8u392-ga-1~22.04-b08
Test Resultshttps://ci-hadoop.apache.org/job/tez-multibranch/job/PR-324/3/testReport/
Max. process+thread count457 (vs. ulimit of 5500)
modulesC: tez-api tez-common tez-runtime-internals tez-dag U: .
Console outputhttps://ci-hadoop.apache.org/job/tez-multibranch/job/PR-324/3/console
versionsgit=2.34.1 maven=3.6.3 findbugs=3.0.1
Powered byApache Yetus 0.12.0 https://yetus.apache.org

This message was automatically generated.

@@ -2207,7 +2210,9 @@ public Void run() throws Exception {
}

// Check if the thread dump service is up in any case, if yes attempt a shutdown

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.

remove thread dump helper related comment, and change to a more generic one that tells we're about to stop hooks if they are running in any case

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.

@abstractdog

Copy link
Copy Markdown
Contributor

@okumin : thanks for the patch, nice refactor, only minor comments, other than that, it looks good to me!

@okumin

Copy link
Copy Markdown
ContributorAuthor

Thanks. I think all the points follow your suggestions. I rebased the branch as the original one was already obsolete

@tez-yetus

Copy link
Copy Markdown

🎊 +1 overall

VoteSubsystemRuntimeComment
+0 🆗reexec25m 59sDocker mode activated.
_ Prechecks _
+1 💚dupname0m 0sNo case conflicting files found.
+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 _
+0 🆗mvndep2m 53sMaven dependency ordering for branch
+1 💚mvninstall13m 33smaster passed
+1 💚compile2m 53smaster passed with JDK Ubuntu-11.0.25+9-post-Ubuntu-1ubuntu122.04
+1 💚compile2m 37smaster passed with JDK Private Build-1.8.0_432-8u432-gaus1-0ubuntu222.04-ga
+1 💚checkstyle2m 38smaster passed
+1 💚javadoc2m 21smaster passed with JDK Ubuntu-11.0.25+9-post-Ubuntu-1ubuntu122.04
+1 💚javadoc2m 6smaster passed with JDK Private Build-1.8.0_432-8u432-gaus1-0ubuntu222.04-ga
+0 🆗spotbugs0m 50sUsed deprecated FindBugs config; considering switching to SpotBugs.
+1 💚findbugs5m 11smaster passed
_ Patch Compile Tests _
+0 🆗mvndep0m 10sMaven dependency ordering for patch
+1 💚mvninstall1m 43sthe patch passed
+1 💚compile1m 51sthe patch passed with JDK Ubuntu-11.0.25+9-post-Ubuntu-1ubuntu122.04
+1 💚javac1m 51sthe patch passed
+1 💚compile1m 34sthe patch passed with JDK Private Build-1.8.0_432-8u432-gaus1-0ubuntu222.04-ga
+1 💚javac1m 34sthe patch passed
-0 ⚠️checkstyle0m 10stez-runtime-internals: The patch generated 1 new + 7 unchanged - 0 fixed = 8 total (was 7)
+1 💚whitespace0m 0sThe patch has no whitespace issues.
+1 💚javadoc1m 2sthe patch passed with JDK Ubuntu-11.0.25+9-post-Ubuntu-1ubuntu122.04
+1 💚javadoc1m 1sthe patch passed with JDK Private Build-1.8.0_432-8u432-gaus1-0ubuntu222.04-ga
+1 💚findbugs4m 9sthe patch passed
_ Other Tests _
+1 💚unit2m 15stez-api in the patch passed.
+1 💚unit0m 26stez-common in the patch passed.
+1 💚unit0m 47stez-runtime-internals in the patch passed.
+1 💚unit4m 49stez-dag in the patch passed.
+1 💚unit40m 54stez-tests in the patch passed.
+1 💚asflicense0m 55sThe patch does not generate ASF License warnings.
125m 6s
SubsystemReport/Notes
DockerClientAPI=1.47 ServerAPI=1.47 base: https://ci-hadoop.apache.org/job/tez-multibranch/job/PR-324/4/artifact/out/Dockerfile
GITHUB PR#324
JIRA IssueTEZ-4527
Optional Testsdupname asflicense javac javadoc unit spotbugs findbugs checkstyle compile
unameLinux cebf547baff1 5.15.0-125-generic #135-Ubuntu SMP Fri Sep 27 13:53:58 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux
Build toolmaven
Personalitypersonality/tez.sh
git revisionmaster / ca15119
Default JavaPrivate Build-1.8.0_432-8u432-gaus1-0ubuntu222.04-ga
Multi-JDK versions/usr/lib/jvm/java-11-openjdk-amd64:Ubuntu-11.0.25+9-post-Ubuntu-1ubuntu122.04 /usr/lib/jvm/java-8-openjdk-amd64:Private Build-1.8.0_432-8u432-gaus1-0ubuntu222.04-ga
checkstylehttps://ci-hadoop.apache.org/job/tez-multibranch/job/PR-324/4/artifact/out/diff-checkstyle-tez-runtime-internals.txt
Test Resultshttps://ci-hadoop.apache.org/job/tez-multibranch/job/PR-324/4/testReport/
Max. process+thread count1203 (vs. ulimit of 5500)
modulesC: tez-api tez-common tez-runtime-internals tez-dag tez-tests U: .
Console outputhttps://ci-hadoop.apache.org/job/tez-multibranch/job/PR-324/4/console
versionsgit=2.34.1 maven=3.6.3 findbugs=3.0.1
Powered byApache Yetus 0.12.0 https://yetus.apache.org

This message was automatically generated.

"path: {}", duration, basePath);
}

public TezThreadDumpHelper() {

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.

hm, cannot recall what the purpose was of this constructor, does reflection work without this explicitly defined?
I'm afraid that as there is private parameterized constructor, class.newInstance() throws an InstantiationException, doesn't it?

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.

It is originally needed to instantiate

privatestaticclassNoopTezThreadDumpHelperextendsTezThreadDumpHelper {
@Override
publicTezThreadDumpHelperstart(Stringname) {
// Do Nothing
returnthis;
}
@Override
publicvoidstop() {
// Do Nothing
}
}
with zero arguments.

I think the class is not constructed in a reflective way, or it doesn't assume it's reflectively operated. I slightly updated the modifiers to make sure it
61d8249

@abstractdogabstractdogDec 22, 2024

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.

right, I was wrong, the hooks are created by reflection, but the TezThreadDumpHelper is not

 helper = TezThreadDumpHelper.getInstance(conf).start(id.toString());

@ConfigurationProperty
public static final String TEZ_THREAD_DUMP_INTERVAL = "tez.thread.dump.interval";
public static final String TEZ_THREAD_DUMP_INTERVAL_DEFAULT = "0ms";
public static final String TEZ_HOOK_THREAD_DUMP_INTERVAL = "tez.hook.thread.dump.interval";

@abstractdogabstractdogDec 22, 2024

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.

@okumin : I'm terribly sorry, I just realized that changing this causes more problems than benefits (changing config opts from one release to another), the class name also doesn't have "hook" in it, so it's fine to have this as "tez.thread.dump.interval", are you fine with changing back? TEZ_THREAD_DUMP_INTERVAL was also fine from this point of view

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.

np. I renamed them back
293ce63

@abstractdog

Copy link
Copy Markdown
Contributor

Thanks. I think all the points follow your suggestions. I rebased the branch as the original one was already obsolete

thanks @okumin , this is very close, just left 2 comments

@abstractdog
abstractdog self-requested a review December 22, 2024 09:44

@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 +1

@tez-yetus

Copy link
Copy Markdown

🎊 +1 overall

VoteSubsystemRuntimeComment
+0 🆗reexec0m 33sDocker mode activated.
_ Prechecks _
+1 💚dupname0m 0sNo case conflicting files found.
+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 _
+0 🆗mvndep2m 53sMaven dependency ordering for branch
+1 💚mvninstall13m 20smaster passed
+1 💚compile2m 53smaster passed with JDK Ubuntu-11.0.25+9-post-Ubuntu-1ubuntu122.04
+1 💚compile2m 37smaster passed with JDK Private Build-1.8.0_432-8u432-gaus1-0ubuntu222.04-ga
+1 💚checkstyle2m 38smaster passed
+1 💚javadoc2m 24smaster passed with JDK Ubuntu-11.0.25+9-post-Ubuntu-1ubuntu122.04
+1 💚javadoc2m 6smaster passed with JDK Private Build-1.8.0_432-8u432-gaus1-0ubuntu222.04-ga
+0 🆗spotbugs0m 47sUsed deprecated FindBugs config; considering switching to SpotBugs.
+1 💚findbugs5m 7smaster passed
_ Patch Compile Tests _
+0 🆗mvndep0m 10sMaven dependency ordering for patch
+1 💚mvninstall1m 40sthe patch passed
+1 💚compile1m 48sthe patch passed with JDK Ubuntu-11.0.25+9-post-Ubuntu-1ubuntu122.04
+1 💚javac1m 48sthe patch passed
+1 💚compile1m 36sthe patch passed with JDK Private Build-1.8.0_432-8u432-gaus1-0ubuntu222.04-ga
+1 💚javac1m 36sthe patch passed
-0 ⚠️checkstyle0m 10stez-runtime-internals: The patch generated 1 new + 7 unchanged - 0 fixed = 8 total (was 7)
+1 💚whitespace0m 0sThe patch has no whitespace issues.
+1 💚javadoc1m 3sthe patch passed with JDK Ubuntu-11.0.25+9-post-Ubuntu-1ubuntu122.04
+1 💚javadoc1m 2sthe patch passed with JDK Private Build-1.8.0_432-8u432-gaus1-0ubuntu222.04-ga
+1 💚findbugs4m 14sthe patch passed
_ Other Tests _
+1 💚unit2m 14stez-api in the patch passed.
+1 💚unit0m 25stez-common in the patch passed.
+1 💚unit0m 48stez-runtime-internals in the patch passed.
+1 💚unit4m 49stez-dag in the patch passed.
+1 💚unit42m 22stez-tests in the patch passed.
+1 💚asflicense0m 57sThe patch does not generate ASF License warnings.
100m 52s
SubsystemReport/Notes
DockerClientAPI=1.47 ServerAPI=1.47 base: https://ci-hadoop.apache.org/job/tez-multibranch/job/PR-324/5/artifact/out/Dockerfile
GITHUB PR#324
JIRA IssueTEZ-4527
Optional Testsdupname asflicense javac javadoc unit spotbugs findbugs checkstyle compile
unameLinux 972ccfe046fc 5.15.0-125-generic #135-Ubuntu SMP Fri Sep 27 13:53:58 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux
Build toolmaven
Personalitypersonality/tez.sh
git revisionmaster / ca15119
Default JavaPrivate Build-1.8.0_432-8u432-gaus1-0ubuntu222.04-ga
Multi-JDK versions/usr/lib/jvm/java-11-openjdk-amd64:Ubuntu-11.0.25+9-post-Ubuntu-1ubuntu122.04 /usr/lib/jvm/java-8-openjdk-amd64:Private Build-1.8.0_432-8u432-gaus1-0ubuntu222.04-ga
checkstylehttps://ci-hadoop.apache.org/job/tez-multibranch/job/PR-324/5/artifact/out/diff-checkstyle-tez-runtime-internals.txt
Test Resultshttps://ci-hadoop.apache.org/job/tez-multibranch/job/PR-324/5/testReport/
Max. process+thread count1173 (vs. ulimit of 5500)
modulesC: tez-api tez-common tez-runtime-internals tez-dag tez-tests U: .
Console outputhttps://ci-hadoop.apache.org/job/tez-multibranch/job/PR-324/5/console
versionsgit=2.34.1 maven=3.6.3 findbugs=3.0.1
Powered byApache Yetus 0.12.0 https://yetus.apache.org

This message was automatically generated.

@abstractdog
abstractdog merged commit 1084699 into apache:masterDec 22, 2024
@okumin
okumin deleted the TEZ-4527-hook branch December 22, 2024 12:48
@okumin

Copy link
Copy Markdown
ContributorAuthor

Thank you. This change is so helpful for us

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

@okumin@tez-yetus@abstractdog