You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dolphinscheduler.apache.org by "unigof (via GitHub)" <gi...@apache.org> on 2025/08/11 12:36:40 UTC

[I] [Bug] [Master] Worker HostWeight calc error when dispatch task instance [dolphinscheduler]

unigof opened a new issue, #17407:
URL: https://github.com/apache/dolphinscheduler/issues/17407

   ### Search before asking
   
   - [x] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues.
   
   
   ### What happened
   
   When I configured worker grafana,  I found almost all task instance be dispatched to same worker node. There are error for calculating HostWeight when using `LowerWeightHostManager`, details as below:
   
   ```
       HostWeight.java
       private double calculateWeight(double cpuUsage,
                                      double memoryUsage,
                                      double diskUsage,
                                      double threadPoolUsage,
                                      long startTime) {
           double calculatedWeight = 100 - (cpuUsage * CPU_USAGE_FACTOR + memoryUsage * MEMORY_USAGE_FACTOR
                   + diskUsage * DISK_USAGE_FACTOR + threadPoolUsage * THREAD_USAGE_FACTOR);
           long uptime = System.currentTimeMillis() - startTime;
           if (uptime > 0 && uptime < Constants.WARM_UP_TIME) {
               // If the warm-up is not over, add the weight
               return calculatedWeight * Constants.WARM_UP_TIME / uptime;
           }
           return calculatedWeight;
       }
   ```
   The `calculatedWeight` was reduced by 100, so the smallest value represent the biggest weight. But when select worker node using a smallest value:
   ```
      LowerWeightRoundRobin.java
       public HostWeight doSelect(Collection<HostWeight> sources) {
           double totalWeight = 0;
           double lowWeight = 0;
           HostWeight lowerNode = null;
           for (HostWeight hostWeight : sources) {
               totalWeight += hostWeight.getWeight();
               hostWeight.setCurrentWeight(hostWeight.getCurrentWeight() + hostWeight.getWeight());
               if (lowerNode == null || lowWeight > hostWeight.getCurrentWeight()) {
                   lowerNode = hostWeight;
                   lowWeight = hostWeight.getCurrentWeight();
               }
           }
           if (lowerNode != null) {
               lowerNode.setCurrentWeight(lowerNode.getCurrentWeight() + totalWeight);
           }
           return lowerNode;
       }
   ```
   
   ### What you expected to happen
   
   fix it.
   
   ### How to reproduce
   
   Run some task and check grafana, it's config as below:
   ```
   sum(increase(ds_task_execution_count_by_type_total{application="worker-server", namespace=~"$namespace", app_name=~"$app_name", cluster=~"$cluster", instance=~"$instance", task_type="SHELL"}[5m])) by (instance)
   ```
   
   And hostweight and workergroup use default.
   
   ### Anything else
   
   We use ds 3.2.2 version in our production env, so need to fix it.
   
   ### Version
   
   3.2.x
   
   ### Are you willing to submit PR?
   
   - [x] Yes I am willing to submit a PR!
   
   ### Code of Conduct
   
   - [x] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
   


-- 
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: commits-unsubscribe@dolphinscheduler.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [Bug] [Master] Worker HostWeight calc error when dispatch task instance [dolphinscheduler]

Posted by "unigof (via GitHub)" <gi...@apache.org>.
unigof commented on issue #17407:
URL: https://github.com/apache/dolphinscheduler/issues/17407#issuecomment-3177380999

   If 3.2.2 won't be maintained, should be announced that in doc?
   
   BTW, although the community is no longer maintaining version 3.2.2, is there any documentation that lists all known issues with version 3.2.2? This would help those who have used version 3.2.2 understand what issues they may encounter


-- 
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: commits-unsubscribe@dolphinscheduler.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [Bug] [Master] Worker HostWeight calc error when dispatch task instance [dolphinscheduler]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on issue #17407:
URL: https://github.com/apache/dolphinscheduler/issues/17407#issuecomment-3419096049

   This issue has been automatically marked as stale because it has not had recent activity for 30 days. It will be closed in next 7 days if no further activity occurs.


-- 
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: commits-unsubscribe@dolphinscheduler.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [Bug] [Master] Worker HostWeight calc error when dispatch task instance [dolphinscheduler]

Posted by "ruanwenjun (via GitHub)" <gi...@apache.org>.
ruanwenjun commented on issue #17407:
URL: https://github.com/apache/dolphinscheduler/issues/17407#issuecomment-3305595229

   > I met this bug too, is this fixed in new version?
   
   It's better to use random strategy to dispatch the task, since right now, worker report its metrics to master is async, the master cannot know the correct load of worker, the worker need to reject the task if it is overload. However, workers often cannot accurately determine whether they might become overloaded.


-- 
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: commits-unsubscribe@dolphinscheduler.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [Bug] [Master] Worker HostWeight calc error when dispatch task instance [dolphinscheduler]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] closed issue #17407: [Bug] [Master] Worker HostWeight calc error when dispatch task instance
URL: https://github.com/apache/dolphinscheduler/issues/17407


-- 
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: commits-unsubscribe@dolphinscheduler.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [Bug] [Master] Worker HostWeight calc error when dispatch task instance [dolphinscheduler]

Posted by "SbloodyS (via GitHub)" <gi...@apache.org>.
SbloodyS commented on issue #17407:
URL: https://github.com/apache/dolphinscheduler/issues/17407#issuecomment-3174720063

   3.2.2 will not issue a new fixed version. We will continue to optimize based on 3.3.0.


-- 
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: commits-unsubscribe@dolphinscheduler.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [Bug] [Master] Worker HostWeight calc error when dispatch task instance [dolphinscheduler]

Posted by "Kitsune2077 (via GitHub)" <gi...@apache.org>.
Kitsune2077 commented on issue #17407:
URL: https://github.com/apache/dolphinscheduler/issues/17407#issuecomment-3301533762

   I met this bug too, is this fixed?


-- 
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: commits-unsubscribe@dolphinscheduler.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [Bug] [Master] Worker HostWeight calc error when dispatch task instance [dolphinscheduler]

Posted by "ruanwenjun (via GitHub)" <gi...@apache.org>.
ruanwenjun commented on issue #17407:
URL: https://github.com/apache/dolphinscheduler/issues/17407#issuecomment-3177423940

   > If 3.2.2 won't be maintained, should be announced that in doc?
   > 
   > BTW, although the community is no longer maintaining version 3.2.2, is there any documentation that lists all known issues with version 3.2.2? This would help those who have used version 3.2.2 understand what issues they may encounter. [@SbloodyS](https://github.com/SbloodyS) [@ruanwenjun](https://github.com/ruanwenjun)
   
   Yes, it’s better to mention this in the documentation


-- 
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: commits-unsubscribe@dolphinscheduler.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [Bug] [Master] Worker HostWeight calc error when dispatch task instance [dolphinscheduler]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on issue #17407:
URL: https://github.com/apache/dolphinscheduler/issues/17407#issuecomment-3449084461

   This issue has been closed because it has not received response for too long time. You could reopen it if you encountered similar problems in the future.


-- 
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: commits-unsubscribe@dolphinscheduler.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [Bug] [Master] Worker HostWeight calc error when dispatch task instance [dolphinscheduler]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on issue #17407:
URL: https://github.com/apache/dolphinscheduler/issues/17407#issuecomment-3283067709

   This issue has been automatically marked as stale because it has not had recent activity for 30 days. It will be closed in next 7 days if no further activity occurs.


-- 
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: commits-unsubscribe@dolphinscheduler.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org