tusaryan opened a new pull request, #17159:
URL: https://github.com/apache/dolphinscheduler/pull/17159

   <!--Thanks very much for contributing to Apache DolphinScheduler, we are 
happy that you want to help us improve DolphinScheduler! -->
   
   ## Purpose of the pull request
   
   <!--(For example: This pull request adds checkstyle plugin).-->
   This Pull Request implements a new configuration option 
`max.concurrent.workflow.instances` in the master server, allowing 
administrators to set a limit on the number of concurrently running workflow 
instances on a single master. This addresses the issue of potential overload 
when multiple workflows failover to a single master, as described in #17157.
   
   ## Brief change log
   
   
   - Added a new configuration property `max.concurrent.workflow.instances` in 
`application.yaml` under the `server-load-protection` section. This property is 
optional and defaults to no limit if not set.
   - Modified `MasterServerLoadProtection.java` to read and utilize the new 
configuration property.
   - Implemented logic in `MasterServerLoadProtection` to check the current 
count of running workflow instances (obtained from `WorkflowCacheRepository`) 
against the configured limit.
   - Updated the `isOverload` method in `MasterServerLoadProtection` to return 
`true` if the concurrent workflow instance count exceeds the configured 
maximum, marking the master as busy.
   - Created a new configuration class `MasterServerLoadProtectionConfig.java` 
to properly inject `WorkflowCacheRepository` into the 
`MasterServerLoadProtection` instance.
   - Updated `MasterServerLoadProtectionTest.java` to include a test case 
verifying the new functionality where the master is marked as overloaded when 
the concurrent workflow instance count exceeds the configured limit.
   
   ## Verify this pull request
   
   This change added tests and can be verified as follows:
   - Updated `MasterServerLoadProtectionTest.java` with a new test method 
(`testIsOverload_maxConcurrentWorkflowInstances`) to specifically test the 
behavior when the number of running workflow instances reaches or exceeds the 
configured `max.concurrent.workflow.instances` limit.
   
   fix issue: [Improvement][Master] Support set 
max.concurrent.workflow.instances in master #17157
   
   
   ## Pull Request Notice
   [Pull Request 
Notice](https://github.com/apache/dolphinscheduler/blob/dev/docs/docs/en/contribute/join/pull-request.md)
   
   If your pull request contains incompatible change, you should also add it to 
`docs/docs/en/guide/upgrade/incompatible.md`
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to