You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by "wenzhenghu (via GitHub)" <gi...@apache.org> on 2026/02/03 02:11:49 UTC
[I] [Bug] query_time based workload policy not work due to wrong finish_time_ [doris]
wenzhenghu opened a new issue, #60454:
URL: https://github.com/apache/doris/issues/60454
### Search before asking
- [x] I had searched in the [issues](https://github.com/apache/doris/issues?q=is%3Aissue) and found no similar issues.
### Version
branch 4.0 and master
### What's Wrong?
```
void finish() {
if (!is_finished_) {
is_finished_ = true;
finish_time_ = MonotonicMillis();
}
finish_impl();
}
```
finish_time_ is updated in finish(), but before that , it will be used in
```
int64_t running_time() const { return finish_time() - start_time(); }
int64_t finish_time() const { return finish_time_; } // finish_time_ inited value is 0
```
when query is running , it will be checked if match the workload policy by
```
bool WorkloadSchedPolicy::is_match(WorkloadAction::RuntimeContext* action_runtime_ctx) const {
...
switch (cond->get_workload_metric_type()) {
case WorkloadMetricType::QUERY_TIME: {
val = std::to_string(
action_runtime_ctx->resource_ctx->task_controller()->running_time());
break;
}
...
if (!cond->eval(val)) {
return false;
}
...
}
bool WorkloadConditionQueryTime::eval(std::string str_val) {
int64_t query_time_args = std::stol(str_val);
return WorkloadCompareUtils::compare_signed_integer(_op, query_time_args, _query_time);
}
```
### What You Expected?
fix it
### How to Reproduce?
create a workload policy like this
```
create workload Policy test_cancel_Policy
Conditions(query_time > 3000)
Actions(cancel_query)
properties('enabled'='true');
```
and run tpcds/tpch100, query will not killed by query time exceed. what expectd is
`cancelled by workload policy: test_cancel_3s_query, id:1770025926146, query_time:3491(3000)`
### Anything Else?
_No response_
### 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@doris.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org
Re: [I] [Bug] query_time based workload policy not work due to wrong finish_time_ [doris]
Posted by "yiguolei (via GitHub)" <gi...@apache.org>.
yiguolei closed issue #60454: [Bug] query_time based workload policy not work due to wrong finish_time_
URL: https://github.com/apache/doris/issues/60454
--
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@doris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org