Skip to content

[Bug] Fix Yarn running state fallback#4360

Open
hutiefang76 wants to merge 1 commit into
apache:devfrom
hutiefang76:codex/fix-yarn-running-state
Open

[Bug] Fix Yarn running state fallback#4360
hutiefang76 wants to merge 1 commit into
apache:devfrom
hutiefang76:codex/fix-yarn-running-state

Conversation

@hutiefang76

Copy link
Copy Markdown

What changes were proposed in this pull request

Issue Number: close #4356

When StreamPark falls back to Yarn after failing to get the task status from the Flink REST API, it currently reads Yarn finalStatus. For an application that is still in progress, Yarn usually reports finalStatus=UNDEFINED while the actual application state is in the state field, for example RUNNING.

This change resolves the Yarn application state by:

  • using finalStatus when it maps to a known terminal result such as SUCCEEDED, FAILED, or KILLED
  • falling back to Yarn state when finalStatus is not a known StreamPark state, so running applications can be updated as RUNNING instead of being skipped

Brief change log

  • Add resolveYarnAppState for Yarn state/finalStatus conversion in FlinkAppHttpWatcher
  • Use the resolver in both Yarn fallback paths
  • Add unit coverage for finalStatus=UNDEFINED,state=RUNNING, terminal SUCCEEDED, and missing app info

Verifying this change

This change added tests and can be verified as follows:

  • git diff --check -- streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/watcher/FlinkAppHttpWatcher.java streampark-console/streampark-console-service/src/test/java/org/apache/streampark/console/core/watcher/FlinkAppHttpWatcherTest.java
  • JAVA_HOME=$(/usr/libexec/java_home -v 17) ./mvnw -pl streampark-console/streampark-console-service -am -Dtest=FlinkAppHttpWatcherTest -Dsurefire.failIfNoSpecifiedTests=false test

Does this pull request potentially affect one of the following parts

  • Dependencies (does it add or upgrade a dependency): 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] After obtaining an exception in task status from Flink, the intermediate task status obtained from Yarn was not updated

1 participant