Commit d871ef7
committed
policies: fix overflow in
Problem: issue #1129 reported `EOVERFLOW` errors for match requests for
thousands of CPUs and GPUs. Currently, `calc_factor` computes the tie
breaking factor with modular arithmetic. The computation returns
-1 when `break_tie` is divisible by `m_multiply_by`.
The negative value of `tie` causes the following integer check to
overflow, generating a spurious `EOVERFLOW` errno.
Fix the computation to ensure `tie` is strictly positive with `abs()`.calc_factor
1 parent f5f99c5 commit d871ef7
1 file changed
+1
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
55 | 55 | | |
56 | 56 | | |
57 | 57 | | |
58 | | - | |
| 58 | + | |
59 | 59 | | |
60 | 60 | | |
61 | 61 | | |
| |||
0 commit comments