Skip to content

[Fix] Handle NPE when HADOOP_HOME is not set in K8s application mode (#4304) - #4505

Open
zhang-arvin wants to merge 1 commit into
apache:devfrom
zhang-arvin:fix/issue-4304-k8s-npe-hadoop
Open

[Fix] Handle NPE when HADOOP_HOME is not set in K8s application mode (#4304)#4505
zhang-arvin wants to merge 1 commit into
apache:devfrom
zhang-arvin:fix/issue-4304-k8s-npe-hadoop

Conversation

@zhang-arvin

Copy link
Copy Markdown

What changes were proposed in this pull request?

Wrap the Workspace.ARCHIVES_FILE_PATH() call in FlinkApplicationActionServiceImpl with a try-catch block to handle the case when HADOOP_HOME is not set in Kubernetes application mode.

Why are the changes needed?

Fixes #4304. When deploying Flink jobs in Kubernetes application mode without a Hadoop environment, Workspace.ARCHIVES_FILE_PATH() throws a NullPointerException because HdfsUtils.getDefaultFS() requires HADOOP_HOME. This PR catches the exception and logs a warning instead of crashing.

Does this PR introduce any user-facing change?

No.

@sonarqubecloud

Copy link
Copy Markdown

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] 使用k8s application模式部署任务时,如果没有Hadoop环境,会在某一个properties设置的时候报错导致无法运行

1 participant