You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Nov 24, 2025. It is now read-only.
In delivery service steering, the response isn't correct if config two or more targets whose types are STEERING_ORDER and values are negative.
Root cause analysis:
In function synthesizeZeroHashes(), if hashableMap is empty, the initial position for putting the zero hashable with negative order value will be 0 (the variable minHash).
In the following process, 0 will be selected as the hash value for the first zero hashable, then the negative values -1, -2, ... in type long will be tried to generate the hash value in type double for the other zero hashables. There are three issues:
The NaN will be generated as the hash value next to the hash value 0. This will cause wrong result.
There are a large number of negative values -1, -2, ... in type long will be mapped to NaN in type double. This will consume much computation and cause slow response.
The negative values in type long and type double aren't correct in this scenario. For the negative values, the value in double type is ascending when the value in type long is descending (ref the function getSafeHash).
In delivery service steering, the response isn't correct if config two or more targets whose types are STEERING_ORDER and values are negative.
Root cause analysis:
In function synthesizeZeroHashes(), if hashableMap is empty, the initial position for putting the zero hashable with negative order value will be 0 (the variable minHash).
In the following process, 0 will be selected as the hash value for the first zero hashable, then the negative values -1, -2, ... in type long will be tried to generate the hash value in type double for the other zero hashables. There are three issues:
The NaN will be generated as the hash value next to the hash value 0. This will cause wrong result.
There are a large number of negative values -1, -2, ... in type long will be mapped to NaN in type double. This will consume much computation and cause slow response.
The negative values in type long and type double aren't correct in this scenario. For the negative values, the value in double type is ascending when the value in type long is descending (ref the function getSafeHash).