Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .server-changes/task-run-metrics-query-time-limit.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
area: webapp
type: fix
---

Task metrics that take too long to load now stop with a clear error instead of hanging until the request gives up
10 changes: 8 additions & 2 deletions internal-packages/clickhouse/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -232,10 +232,16 @@ export class ClickHouse {
existsQueryBuilder: getTaskRunExistsQueryBuilder(this.reader, { max_execution_time: 10 }),
tagQueryBuilder: getTaskRunTagsQueryBuilder(this.reader),
pendingVersionIdsQueryBuilder: getPendingVersionIdsQueryBuilder(this.reader),
getTaskActivity: getTaskActivityQueryBuilder(this.reader),
// Cap these server-side. The client's `request_timeout` defaults to 30s, and
// without a `max_execution_time` that timeout is the only thing that stops a
// slow query — it aborts the HTTP request rather than the query, so the
// failure arrives as an untyped socket timeout. 25s keeps every query that
// currently succeeds while letting ClickHouse terminate its own work first
// and return a proper timeout error.
getTaskActivity: getTaskActivityQueryBuilder(this.reader, { max_execution_time: 25 }),
getCurrentRunningStats: getCurrentRunningStats(this.reader),
getChildRunStatusCounts: getChildRunStatusCounts(this.reader),
getAverageDurations: getAverageDurations(this.reader),
getAverageDurations: getAverageDurations(this.reader, { max_execution_time: 25 }),
getTaskUsageByOrganization: getTaskUsageByOrganization(this.reader),
};
}
Expand Down