[ 
https://issues.apache.org/jira/browse/TEZ-4686?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18059885#comment-18059885
 ] 

László Bodor commented on TEZ-4686:
-----------------------------------

thanks [~Aggarwal_Raghav] for the wordcount example, I'll take a look
this standalone example can make its way to the tez repo eventually

regarding the NPE, I believe it's related to this: 
https://github.com/apache/tez/blob/f09ba7faffff18e3197a4963764a34b69a22d656/tez-api/src/main/java/org/apache/tez/client/registry/zookeeper/ZkFrameworkClient.java#L81-L110
the reason I made this details comment was to clarify a valid and working 
scenario, in which case such NPEs cannot happen, but that doesn't mean it's 
perfect, there is always a room for improvement

> NPE when tez-client tries to connect to AM via ZK Mode
> ------------------------------------------------------
>
>                 Key: TEZ-4686
>                 URL: https://issues.apache.org/jira/browse/TEZ-4686
>             Project: Apache Tez
>          Issue Type: Bug
>            Reporter: Raghav Aggarwal
>            Assignee: Raghav Aggarwal
>            Priority: Major
>         Attachments: docker_am.txt, hs2_stacktrace.txt, tezClientLogs.txt
>
>
> Stacktrace:
> {code:java}
> 2026-02-15 20:50:20,609 INFO zookeeper.ZkAMRegistryClient: AM registered with 
> data: {hostName=cb86f81d582a, externalId=tez-session-, hostIp=172.17.0.2, 
> port=10001, computeName=default-compute, 
> appId=application_1769280834537_0000}. Notifying listeners.2026-02-15 
> 20:50:20,672 INFO zookeeper.ZooKeeper: Session: 0x100040757d70034 
> closed2026-02-15 20:50:20,672 INFO zookeeper.ClientCnxn: EventThread shut 
> down for session: 0x100040757d70034Exception in thread "main" 
> java.lang.NullPointerException: Cannot invoke 
> "org.apache.tez.client.registry.AMRecord.getApplicationId()" because 
> "this.amRecord" is null   at 
> org.apache.tez.client.registry.zookeeper.ZkFrameworkClient.createApplication(ZkFrameworkClient.java:114)
>      at 
> org.apache.tez.client.TezClient.createApplication(TezClient.java:1103)       
> at org.apache.tez.client.TezClient.start(TezClient.java:399) {code}
>  
> I have written a standalone tez job for word count and configured to use 
> zookeeper mode. The stacktrace is observed when running that program. The 
> similar stacktrace is observed when using tez(master) with hive(master). Will 
> attach the stacktraces, logs in attachment.
>  
> NOTE: Based on the javadoc 
> [https://github.com/apache/tez/blob/4632058795de8f871504601d5f2992f311be792a/tez-api/src/main/java/org/apache/tez/client/registry/zookeeper/ZkFrameworkClient.java#L91]
>  the stacktrace code path is defying the hidden assumption.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to