-
Notifications
You must be signed in to change notification settings - Fork 9.1k
YARN-11781. Implement Dynamic Requests Handling in CapacityScheduler #7448
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
base: trunk
Are you sure you want to change the base?
Conversation
This comment was marked as outdated.
This comment was marked as outdated.
💔 -1 overall
This message was automatically generated. |
🎊 +1 overall
This message was automatically generated. |
try { | ||
reinitRequestsHandler(this.conf); | ||
} catch (Throwable innerT) { | ||
LOG.error("Failed to re-init requests handler : {}", |
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.
Will the basic functions be affected if the initialization fails?
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.
Thanks @zeekling for the review.
oldConf is a configuration that has already been validated and is in effect, the invocation of CapacityScheduler#reinitRequestsHandler here will not throw an exception actually. The purpose of this try/catch block is only included to make sure that the original rollback logic remains unaffected.
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.
got it
public RequestsHandleResponse handle(FiCaSchedulerApp app, | ||
List<ResourceRequest> resourceRequests, | ||
List<SchedulingRequest> schedulingRequests) { | ||
readLock.lock(); |
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.
This is an update operator, why use readLock?
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 readLock and writeLock are used to protect fields in RequestsHandler such as enabled and updateItems, which can be used concurrently, for example, they could be updated while refreshQueues is called in a RPC thread, meanwhile could be read to handle requests in other RPC threads. So that these fields should be modified exclusively in the initialize method (requiring writeLock for mutual exclusion) but only read concurrently in the handle method (where readLock enables multiple threads to access the shared state simultaneously without blocking).
💔 -1 overall
This message was automatically generated. |
💔 -1 overall
This message was automatically generated. |
Description of PR
Details:
Usage: To enable and configure the request handler, administrators can set the following properties in capacity-scheduler.xml:
yarn.scheduler.capacity.request-handler.enabled: Enables or disables the request handler.
yarn.scheduler.capacity.request-handler.updates: Specifies the JSON configuration for the request updates.
Configuration example:
How was this patch tested?
For code changes:
LICENSE
,LICENSE-binary
,NOTICE-binary
files?