apache / linkis

Apache Linkis builds a computation middleware layer to facilitate connection, governance and orchestration between the upper applications and the underlying data engines.
https://linkis.apache.org/
Apache License 2.0
3.29k stars 1.16k forks source link

[Bug] The sortByResource method in ResourceNodeSelectRule violates the general contract of comparators #4911

Closed sjgllgh closed 11 months ago

sjgllgh commented 11 months ago

Search before asking

Linkis Component

linkis-computation-governance

Steps to reproduce

  1. When there are many deployed ECMs and the concurrency is high, an exception may be thrown: Comparison method violates its general contract!
  2. The comparison method provided by the code is: when memory, CPU, and the number of instances are all large, return -1; when memory, CPU, and the number of instances are all equal, return 0; in all other cases, return 1.
  3. There may be situations where, when the memory of A is larger than that of B, and the CPU of B is larger than that of A, the comparison between A and B will always return 1.

Expected behavior

Modify the rules of the comparator to prevent violating the general contract of the comparator.

Your environment

Anything else

No response

Are you willing to submit a PR?

github-actions[bot] commented 11 months ago

:blush: Welcome to the Apache Linkis community!!

We are glad that you are contributing by opening this issue.

Please make sure to include all the relevant context. We will be here shortly.

If you are interested in contributing to our website project, please let us know! You can check out our contributing guide on :point_right: How to Participate in Project Contribution.

Community

WeChat Assistant WeChat Public Account

Mailing Lists

Name Description Subscribe Unsubscribe Archive
dev@linkis.apache.org community activity information subscribe unsubscribe archive