feat(scheduler): make node lock timeout configurable#1117
feat(scheduler): make node lock timeout configurable#1117archlitchi merged 1 commit intoProject-HAMi:masterfrom
Conversation
7cbe542 to
bcc23f4
Compare
|
have you tested on your environment? |
|
5791392 to
40d7b4b
Compare
|
/lgtm |
Codecov ReportAttention: Patch coverage is
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
- Add configurable node lock timeout parameter to scheduler config - Add --node-lock-timeout flag to scheduler command line options - Change NodeLockTimeout type from int to time.Duration for better type safety - Update command line flag to use DurationVar instead of IntVar - Remove default value description from comment as suggested in code review - Initialize nodelock.NodeLockTimeout from config at startup - Default timeout set to 5 minutes but now can be customized - Support flexible time units (e.g., 30s, 2m, 1h) instead of just minutes - This allows operators to tune lock timeout based on cluster characteristics This addresses code review feedback from wawa0210 regarding: 1. Using proper time.Duration type for timeout configuration 2. Removing redundant default value comments Signed-off-by: Kevinz857 <kevinnz@foxmail.com>
40d7b4b to
8e45320
Compare
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: Kevinz857 The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
/lgtm |
Summary
This PR makes the HAMi scheduler's node lock timeout configurable, allowing operators to adjust the timeout duration based on their cluster characteristics and scheduling requirements.
Changes Made
Configuration Layer (
pkg/scheduler/config/config.go)NodeLockTimeout intconfiguration parameterCommand Line Interface (
cmd/scheduler/main.go)--node-lock-timeoutflag to scheduler command line optionsstart()functionRuntime Behavior (
pkg/util/nodelock/nodelock.go)NodeLockTimeoutvariable is now set from configurationMotivation
Previously, the node lock timeout was hardcoded to 1 minute. In some cluster environments, this timeout may be too long, causing unnecessary delays in scheduling operations. By making this configurable, operators can:
Backward Compatibility
Default timeout is 5 minute
Custom set 30s
Custom set 2mins