Skip to content

[LIVY-1059] Add livy.spark.yarn.queue configuration to set default YARN queue#529

Open
nileshrathi345 wants to merge 5 commits into
apache:masterfrom
nileshrathi345:master-LIVY1059
Open

[LIVY-1059] Add livy.spark.yarn.queue configuration to set default YARN queue#529
nileshrathi345 wants to merge 5 commits into
apache:masterfrom
nileshrathi345:master-LIVY1059

Conversation

@nileshrathi345

Copy link
Copy Markdown
Contributor

What changes were proposed in this pull request?

This PR introduces support for configuring a default YARN queue at the Livy server level via a new configuration property: livy.spark.yarn.queue.
Previously, if a client did not explicitly specify a YARN queue parameter (queue) in their session creation payload, the session would fall back to the global Hadoop cluster's default YARN queue. This change allows cluster administrators to isolate Livy-generated workloads into a specific default queue without requiring end-users to pass it manually in every API request.

How was this patch tested?

This patch has been thoroughly validated using both newly added automated unit tests and manual API validation:

@nileshrathi345

Copy link
Copy Markdown
Contributor Author

@ArnavBalyan, @gyogal and @roczei could you please take a look when possible thanks!

@ArnavBalyan ArnavBalyan left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks for the changes @nileshrathi345, could you pls look into the CI failures, overall LGTM

Comment thread server/src/main/scala/org/apache/livy/LivyConf.scala
Comment thread server/src/main/scala/org/apache/livy/server/batch/BatchSession.scala Outdated
Comment thread server/src/main/scala/org/apache/livy/server/batch/BatchSessionServlet.scala Outdated

@gyogal gyogal left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks for submitting a PR @nileshrathi345 ! I left two minor comments, could you please check and let me know your thoughts?

@nileshrathi345 nileshrathi345 requested a review from gyogal June 25, 2026 06:18
m.owner,
m.proxyUser,
sessionStore,
None,

@gyogal gyogal Jun 26, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think I now understand why the queue was added to the state store in the previous version, it was so that this value could be populated correctly. Is the queue in BatchSessions used by anything else other than the unit test?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Currently, queue is primarily used during session creation and tracking. However, passing None during recover means that if the Livy server restarts, any recovered batch session will permanently lose its original queue context.
To maintain that have added to the state in previous version

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

It might be possible to remove this and change the unit test in BatchSessionSpec to verify that the queue is set via the mockApp. I am not entirely sure though, but if that is the case this PR could be further simplified.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants