-
Notifications
You must be signed in to change notification settings - Fork 28.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[SPARK-50383][CORE] Support Virtual Threads
in REST Submission API
#48923
Conversation
Virtual Threads
in REST Submission API
Thank you, @viirya ! |
val newVirtualThreadPerTaskExecutor = | ||
classOf[Executors].getMethod("newVirtualThreadPerTaskExecutor") | ||
val service = newVirtualThreadPerTaskExecutor.invoke(null).asInstanceOf[ExecutorService] | ||
threadPool.setVirtualThreadsExecutor(service) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The thread number configured for the threadPool
also determines the number of virtual threads?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For example #48921.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, AFAIK, this is orthogonally handled in Jetty layer, @viirya .
BTW, after merging #48921, I need to rebase this PR to resolve the conflicts. |
cf104cb
to
d7f6dc7
Compare
Rebased to master to resolve conflicts~ |
Merged to master for Apache Spark 4.0.0. |
What changes were proposed in this pull request?
This PR aims to support JEP-444: Virtual Threads in REST Submission API for Apache Spark 4.0.0.
Why are the changes needed?
Virtual Threads
becomes an official feature in Java 21.In addition,
Jetty 11
supportsVirtual Threads
.We had better provide a way to use it via a new option
spark.master.rest.virtualThread.enabled
, which is enabled in Java 21 runtime. Please note that this aims for high-throughput concurrency.Does this PR introduce any user-facing change?
No.
How was this patch tested?
Pass the CIs.
Was this patch authored or co-authored using generative AI tooling?
No.