Skip to content

Commit f81a14c

Browse files
authored
fix(native): Watchdog fails to run on certain setups (#26255)
## Description After a recent change #25855, the Watchdog fails to run if the hardware_concurrency() returns an odd number. The root cause is that `0.5 * hardwareConcurrency()` fails to cast to a `size_t` ## Motivation and Context <!---Why is this change required? What problem does it solve?--> <!---If it fixes an open issue, please link to the issue here.--> ## Impact <!---Describe any public API or user-facing feature change or any performance impact--> ## Test Plan <!---Please fill in how you tested your change--> ## Contributor checklist - [ ] Please make sure your submission complies with our [contributing guide](https://github.com/prestodb/presto/blob/master/CONTRIBUTING.md), in particular [code style](https://github.com/prestodb/presto/blob/master/CONTRIBUTING.md#code-style) and [commit standards](https://github.com/prestodb/presto/blob/master/CONTRIBUTING.md#commit-standards). - [ ] PR description addresses the issue accurately and concisely. If the change is non-trivial, a GitHub Issue is referenced. - [ ] Documented new properties (with its default value), SQL syntax, functions, or other functionality. - [ ] If release notes are required, they follow the [release notes guidelines](https://github.com/prestodb/presto/wiki/Release-Notes-Guidelines). - [ ] Adequate tests were added if applicable. - [ ] CI passed. ``` == NO RELEASE NOTE == ```
1 parent a9f03d8 commit f81a14c

File tree

1 file changed

+1
-1
lines changed
  • presto-native-execution/presto_cpp/main/common

1 file changed

+1
-1
lines changed

presto-native-execution/presto_cpp/main/common/Configs.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ SystemConfig::SystemConfig() {
166166
NUM_PROP(kDriverStuckOperatorThresholdMs, 30 * 60 * 1000),
167167
NUM_PROP(
168168
kDriverCancelTasksWithStuckOperatorsThresholdMs, 40 * 60 * 1000),
169-
NUM_PROP(kDriverNumStuckOperatorsToDetachWorker, 0.5 * hardwareConcurrency()),
169+
NUM_PROP(kDriverNumStuckOperatorsToDetachWorker, std::round(0.5 * hardwareConcurrency())),
170170
NUM_PROP(kSpillerNumCpuThreadsHwMultiplier, 1.0),
171171
STR_PROP(kSpillerFileCreateConfig, ""),
172172
STR_PROP(kSpillerDirectoryCreateConfig, ""),

0 commit comments

Comments
 (0)