Browse Source

[Bug][Worker] get worker status bug (#13992)

* get worker status bug

* modify configuration name
3.2.0-release
Aaron Wang 1 year ago committed by GitHub
parent
commit
731123cebc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      docs/docs/en/architecture/load-balance.md
  2. 4
      docs/docs/zh/architecture/load-balance.md
  3. 6
      dolphinscheduler-worker/src/main/java/org/apache/dolphinscheduler/server/worker/task/WorkerHeartBeatTask.java

4
docs/docs/en/architecture/load-balance.md

@ -55,6 +55,6 @@ If either of these is lower than the configured item, then this worker will not
You can customise the configuration by changing the following properties in worker.properties
- worker.max.cpuload.avg=-1 (worker max cpuload avg, only higher than the system cpu load average, worker server can be dispatched tasks. default value -1: the number of cpu cores * 2)
- worker.reserved.memory=0.3 (worker reserved memory, only lower than system available memory, worker server can be dispatched tasks. default value 0.3, the unit is G)
- worker.max.cpu.load.avg=-1 (worker max cpu load avg, only higher than the system cpu load average, worker server can be dispatched tasks. default value -1: the number of cpu cores * 2)
- worker.reserved.memory=0.3 (worker reserved memory, only lower than system available memory, worker server can be dispatched tasks. default value 0.3, the unit is percentage)

4
docs/docs/zh/architecture/load-balance.md

@ -55,6 +55,6 @@ eg:master.host.selector=random(不区分大小写)
你可以在 worker.properties 修改下面的属性来自定义配置
* worker.max.cpuload.avg=-1 (worker最大cpuload均值,只有高于系统cpuload均值时,worker服务才能被派发任务. 默认值为-1: cpu cores * 2)
* worker.reserved.memory=0.3 (worker预留内存,只有低于系统可用内存时,worker服务才能被派发任务,单位为G)
* worker.max.cpu.load.avg=-1 (worker最大cpu load均值,只有高于系统cpu load均值时,worker服务才能被派发任务. 默认值为-1: cpu cores * 2)
* worker.reserved.memory=0.3 (worker预留内存,只有低于系统可用内存时,worker服务才能被派发任务,单位为百分比)

6
dolphinscheduler-worker/src/main/java/org/apache/dolphinscheduler/server/worker/task/WorkerHeartBeatTask.java

@ -94,10 +94,10 @@ public class WorkerHeartBeatTask extends BaseHeartBeatTask<WorkerHeartBeat> {
double reservedMemory,
int workerExecThreadCount,
int workerWaitingTaskCount) {
if (cpuUsagePercentage > maxCpuUsePercentage || memoryUsagePercentage < reservedMemory) {
if (cpuUsagePercentage > maxCpuUsePercentage || (1 - memoryUsagePercentage) < reservedMemory) {
log.warn(
"current cpu load average {} is higher than {} max.cpuload.avg or available memory {} is lower than {} reserved.memory={}",
cpuUsagePercentage, maxCpuUsePercentage, memoryUsagePercentage, reservedMemory);
"current cpu load average {} is higher than {} or available memory {} is lower than {}",
cpuUsagePercentage, maxCpuUsePercentage, 1 - memoryUsagePercentage, reservedMemory);
return Constants.ABNORMAL_NODE_STATUS;
} else if (workerWaitingTaskCount > workerExecThreadCount) {
log.warn("current waiting task count {} is large than worker thread count {}, worker is busy",

Loading…
Cancel
Save