zhang-arvin opened a new pull request, #18572:
URL: https://github.com/apache/dolphinscheduler/pull/18572
## What is the purpose of the change
Fix #18570: Master self-starvation deadlock when overloaded.
## Brief change log
When a Master becomes overloaded and reports BUSY status, it is excluded
from the NORMAL server list in `MasterClusters.getNormalServers()`. This causes
`MasterSlotManager.doReBalance()` to fail to find itself, setting `currentSlot
= -1`. `IdSlotBasedCommandFetcher` then short-circuits and stops consuming
commands permanently — a self-reinforcing deadlock because the condition that
prevents command consumption (overload) is the same condition that prevents the
master from recovering.
**Fix**: When the current master is not found in the `normalMasterServers`
list, preserve the existing slot value instead of setting it to `-1`. The load
protection at `CommandEngine` level already throttles command consumption when
the server is overloaded.
**Changes**:
- `MasterSlotManager.doReBalance()`: Keep existing slot when current master
is not found in the NORMAL server list (e.g., when BUSY)
- `MasterSlotManagerTest`: Added
`doNotInvalidateSlotWhenCurrentMasterIsBusy` test
## Verify this pull request
- [ ] This change is already covered by existing tests
- [x] This change added tests and can be verified as follows:
- Added `MasterSlotManagerTest.doNotInvalidateSlotWhenCurrentMasterIsBusy`
to verify that slot is preserved when current master is BUSY
## Related issues
Closes #18570
--
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]