Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
package org.apache.tez.dag.app;


import static org.apache.tez.frameworkplugins.FrameworkMode.STANDALONE_ZOOKEEPER;

import java.io.File;
import java.io.FileInputStream;
Expand Down Expand Up @@ -2429,7 +2430,10 @@ public static void main(String[] args) {
Objects.requireNonNull(appSubmitTimeStr,
ApplicationConstants.APP_SUBMIT_TIME_ENV + " is null");

Configuration conf = new Configuration();
Configuration conf =
STANDALONE_ZOOKEEPER.name().equals(System.getenv(TezConstants.TEZ_FRAMEWORK_MODE))
? new TezConfiguration()
: new Configuration();
Comment on lines -2432 to +2436
Copy link
Contributor

@abstractdog abstractdog Feb 20, 2026

Choose a reason for hiding this comment

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

This should be kept somehow in FrameworkUtils, like FrameworkUtils.getInitialConfiguration()
because we might want to hide the details of this "hack" from DAGAppMaster.

Why I call it a hack: it's not because the solution is bad, it's because of the current design, which leads to a catch-22:

  1. we need a Configuration
  2. for that we need to know the framework mode
  3. to know the framework mode and get framework client/server classes we need a Configuration object: getFrameworkService(conf)

so we cannot do anything better than to achieve original Configuration by the value stored in environment...which is fine, but DAGAppMaster's already overwhelmed logic should not contain such a thing

Copy link
Member

Choose a reason for hiding this comment

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

@abstractdog do you have pointer what is different in STANDALONE_ZOOKEEPER that it doesn't work here but does work in YARN mode?

Copy link
Contributor

@abstractdog abstractdog Feb 20, 2026

Choose a reason for hiding this comment

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

hm, that's a good question: I guess here is where we might want to get back to the original motivation: whether a standalone TezAM docker container needs a tez-site.xml on its classpath (and if so, could it read) or if there is another way to configure it... isn't TEZ-4014 or some earlier work already taking care of this? what do you think @Aggarwal-Raghav ?

for (String confFile : confFromXml.getTrimmedStringCollection(TezConfiguration.TEZ_AM_STANDALONE_CONFS)) {
try (InputStream additionalInput = ClassLoader.getSystemResourceAsStream(confFile)) {
Configuration additionalConfFromXml = TezUtilsInternal.readTezConfigurationXml(additionalInput);
confFromXml.addResource(additionalConfFromXml);
}
}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'll get back on this TEZ-4014 analysis in couple of days.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks, @abstractdog, for pointing out TEZ-4014.It works well, provided we pass TEZ_FRAMEWORK_MODE=STANDALONE_ZOOKEEPER as an environment variable (using the --env-file or -e flag in the docker run command) and ensure tez-site.xml is in the classpath.

Without this environment variable, it defaults back to YARN mode. I might have missed passing the -e flag initially while working on TEZ-4682 stared using with new TezConfiguration() as in current TEZ-4682 PR 551075b and never checked back :-(

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'll close this JIRA then


AMExtensions amExtensions = getFrameworkService(conf).getAMExtensions();
DAGProtos.ConfigurationProto confProto = amExtensions.loadConfigurationProto();
Expand Down