Repository navigation
Fix Spark submit standalone status polling to use correct REST endpoint - #71949
Conversation
…vailable attribute in the connection dictionary. Different than previously described, master URLs shouldn't be able to be a comma separated list of hosts.
…In that case use the created rest_endpoint instead
|
Congratulations on your first Pull Request and welcome to the Apache Airflow community! If you have any issues or are unsure about any anything please check our Contributors' Guide
|
|
I did notice PR #71939. However, by that point I had already finished the implementation on my side and only had testing left. I believe both approaches are very similar. My implementation additionally reuses the REST endpoint logic in operator/spark_submit.py to avoid duplicating the endpoint construction. One notable difference I noticed is that my implementation uses a POST request to kill the driver, following Spark's REST API behavior. PR #71939 appears to use DELETE. I'm not sure whether DELETE is also supported here, but POST is what I tested successfully against the Spark Standalone REST endpoint. Besides that there are some minor implementation differences. |
aaron-y-chen
left a comment
There was a problem hiding this comment.
Hi, thanks for the contribution! I've contributed to the Spark provider in the past too, so I hope these review comments are helpful :)
Also, please fix the CI errors. The PR can't be merged until all CI checks pass.
|
Thanks for your supportive insights and review! |
…est for Spark standalone REST endpoint
|
Although I could also have added support for rest_endpoint to handle either a single URL or a comma-separated list of master urls, but that would conflict with the assumption above. I think doing this properly would also require refactoring the usages of connection["master"], either always assume a comma separated list of master url of datatype string or already providing a list of master urls (which results in just one element if not in HA). However, that feels outside the scope of this PR. |
aaron-y-chen
left a comment
There was a problem hiding this comment.
Overall it looks good, please help fix the CI error, and I have one more comment :)
aaron-y-chen
left a comment
There was a problem hiding this comment.
Overall, LGTM. Thanks for your hard work! :)
It needs another look from a committer who is familiar with Spark.
|
Note to reviewer: #71939 is a competing PR |
Nataneljpwd
left a comment
There was a problem hiding this comment.
Looks great, a little hard to choose between the competing pr's, if you could answer my questions it would be appreciated, thank you!
commented
Oct 8, 2026
|
Awesome work, congrats on your first merged pull request! You are invited to check our Issue Tracker for additional contributions. |
Short Description
Using the SparkSubmitOperator to submit an applicaiton to a Spark standalone cluster results in
Failed to poll for the driver status 10 times: returncode = 1even though the job finished correctly on the spark Server side.The issue is caused by the current driver-status polling logic, which derives its behavior from the configured master URL but does not sufficiently distinguish between a master URL pointing to the RPC endpoint on port 7077 and one pointing to the REST endpoint on port 6066.
Changes:
with minimal change to current behaviourif available, else fallback to using the spark submit binary without the rest endpointnew rest_endpoint information has also been applied to the the operator job status requestTests:
Notes
Was generative AI tooling used to co-author this PR?
{pr_number}.significant.rst, in airflow-core/newsfragments. You can add this file in a follow-up commit after the PR is created so you know the PR number.