Database governance built for humans and agents — controlling changes and access across every major database.
Go cicddata-governancedata-maskingdata-securitydatabase-accessdatabase-governancedevopsdevsecopsflywaygitopsliquibasemongodbmysqloraclepostgresqlschema-migrationssecuritysql-clientsqlservertidb
fix: avoid terminal canceling running task runs (#20307)
p0ny6ab1bfe61e9f
diff --git a/backend/api/mcp/gen/openapi.yaml b/backend/api/mcp/gen/openapi.yamlindex df289eeee6..80441059da 100644--- a/backend/api/mcp/gen/openapi.yaml+++ b/backend/api/mcp/gen/openapi.yaml@@ -5035,7 +5035,10 @@ paths:- bytebase.v1.RolloutServicesummary: BatchCancelTaskRunsdescription: |-- Cancels multiple running task executions.+ Cancels multiple task runs.+ PENDING and AVAILABLE task runs are moved to CANCELED synchronously. RUNNING task runs receive+ a best-effort cancellation request and may continue running if the request is missed or the+ executor does not stop. The response does not report which task runs were actually canceled.Permissions required: bb.taskRuns.create (or issue creator for data export issues, or user with rollout policy role for the environment)operationId: bytebase.v1.RolloutService.BatchCancelTaskRunsparameters:diff --git a/backend/api/v1/rollout_service_converter.go b/backend/api/v1/rollout_service_converter.goindex 779323b7ae..575e95db64 100644--- a/backend/api/v1/rollout_service_converter.go+++ b/backend/api/v1/rollout_service_converter.go@@ -344,6 +344,8 @@ func convertToTaskStatus(latestTaskRunStatus storepb.TaskRun_Status, skipped booreturn v1pb.Task_NOT_STARTEDcase storepb.TaskRun_PENDING:return v1pb.Task_PENDING+ case storepb.TaskRun_AVAILABLE:+ return v1pb.Task_PENDINGcase storepb.TaskRun_RUNNING:return v1pb.Task_RUNNINGcase storepb.TaskRun_DONE:diff --git a/backend/generated-go/v1/rollout_service_grpc.pb.go b/backend/generated-go/v1/rollout_service_grpc.pb.goindex f887bcd0bb..786dd350cf 100644--- a/backend/generated-go/v1/rollout_service_grpc.pb.go+++ b/backend/generated-go/v1/rollout_service_grpc.pb.go@@ -65,7 +65,10 @@ type RolloutServiceClient interface {// Skips multiple tasks in a rollout stage.// Permissions required: bb.taskRuns.create (or issue creator for data export issues, or user with rollout policy role for the environment)BatchSkipTasks(ctx context.Context, in *BatchSkipTasksRequest, opts ...grpc.CallOption) (*BatchSkipTasksResponse, error)- // Cancels multiple running task executions.+ // Cancels multiple task runs.+ // PENDING and AVAILABLE task runs are moved to CANCELED synchronously. RUNNING task runs receive+ // a best-effort cancellation request and may continue running if the request is missed or the+ // executor does not stop. The response does not report which task runs were actually canceled.// Permissions required: bb.taskRuns.create (or issue creator for data export issues, or user with rollout policy role for the environment)BatchCancelTaskRuns(ctx context.Context, in *BatchCancelTaskRunsRequest, opts ...grpc.CallOption) (*BatchCancelTaskRunsResponse, error)// Generates rollback SQL for a completed task run.@@ -224,7 +227,10 @@ type RolloutServiceServer interface {// Skips multiple tasks in a rollout stage.// Permissions required: bb.taskRuns.create (or issue creator for data export issues, or user with rollout policy role for the environment)BatchSkipTasks(context.Context, *BatchSkipTasksRequest) (*BatchSkipTasksResponse, error)- // Cancels multiple running task executions.+ // Cancels multiple task runs.+ // PENDING and AVAILABLE task runs are moved to CANCELED synchronously. RUNNING task runs receive+ // a best-effort cancellation request and may continue running if the request is missed or the+ // executor does not stop. The response does not report which task runs were actually canceled.// Permissions required: bb.taskRuns.create (or issue creator for data export issues, or user with rollout policy role for the environment)BatchCancelTaskRuns(context.Context, *BatchCancelTaskRunsRequest) (*BatchCancelTaskRunsResponse, error)// Generates rollback SQL for a completed task run.diff --git a/backend/generated-go/v1/v1connect/rollout_service.connect.go b/backend/generated-go/v1/v1connect/rollout_service.connect.goindex 20c4dda257..b8533474a9 100644--- a/backend/generated-go/v1/v1connect/rollout_service.connect.go+++ b/backend/generated-go/v1/v1connect/rollout_service.connect.go@@ -97,7 +97,10 @@ type RolloutServiceClient interface {// Skips multiple tasks in a rollout stage.// Permissions required: bb.taskRuns.create (or issue creator for data export issues, or user with rollout policy role for the environment)BatchSkipTasks(context.Context, *connect.Request[v1.BatchSkipTasksRequest]) (*connect.Response[v1.BatchSkipTasksResponse], error)- // Cancels multiple running task executions.+ // Cancels multiple task runs.+ // PENDING and AVAILABLE task runs are moved to CANCELED synchronously. RUNNING task runs receive+ // a best-effort cancellation request and may continue running if the request is missed or the+ // executor does not stop. The response does not report which task runs were actually canceled.// Permissions required: bb.taskRuns.create (or issue creator for data export issues, or user with rollout policy role for the environment)BatchCancelTaskRuns(context.Context, *connect.Request[v1.BatchCancelTaskRunsRequest]) (*connect.Response[v1.BatchCancelTaskRunsResponse], error)// Generates rollback SQL for a completed task run.@@ -284,7 +287,10 @@ type RolloutServiceHandler interface {// Skips multiple tasks in a rollout stage.// Permissions required: bb.taskRuns.create (or issue creator for data export issues, or user with rollout policy role for the environment)BatchSkipTasks(context.Context, *connect.Request[v1.BatchSkipTasksRequest]) (*connect.Response[v1.BatchSkipTasksResponse], error)- // Cancels multiple running task executions.+ // Cancels multiple task runs.+ // PENDING and AVAILABLE task runs are moved to CANCELED synchronously. RUNNING task runs receive+ // a best-effort cancellation request and may continue running if the request is missed or the+ // executor does not stop. The response does not report which task runs were actually canceled.// Permissions required: bb.taskRuns.create (or issue creator for data export issues, or user with rollout policy role for the environment)BatchCancelTaskRuns(context.Context, *connect.Request[v1.BatchCancelTaskRunsRequest]) (*connect.Response[v1.BatchCancelTaskRunsResponse], error)// Generates rollback SQL for a completed task run.diff --git a/backend/runner/taskrun/pending_scheduler.go b/backend/runner/taskrun/pending_scheduler.goindex d5fa45779f..cab9abf817 100644--- a/backend/runner/taskrun/pending_scheduler.go+++ b/backend/runner/taskrun/pending_scheduler.go@@ -11,6 +11,7 @@ import ("github.com/pkg/errors""google.golang.org/protobuf/types/known/timestamppb"+ "github.com/bytebase/bytebase/backend/common""github.com/bytebase/bytebase/backend/common/log"storepb "github.com/bytebase/bytebase/backend/generated-go/store""github.com/bytebase/bytebase/backend/store"@@ -187,7 +188,13 @@ func (s *Scheduler) promoteTaskRun(ctx context.Context, taskRun *store.TaskRunMeProjectID: taskRun.ProjectID,Updater: "",Status: storepb.TaskRun_AVAILABLE,+ AllowedStatuses: []storepb.TaskRun_Status{+ storepb.TaskRun_PENDING,+ },}); err != nil {+ if common.ErrorCode(err) == common.Conflict {+ return nil+ }return errors.Wrapf(err, "failed to update task run status to available")}diff --git a/backend/runner/taskrun/running_scheduler.go b/backend/runner/taskrun/running_scheduler.goindex 491b772c9e..70707d3aa4 100644--- a/backend/runner/taskrun/running_scheduler.go+++ b/backend/runner/taskrun/running_scheduler.go@@ -9,6 +9,7 @@ import ("github.com/pkg/errors"+ "github.com/bytebase/bytebase/backend/common""github.com/bytebase/bytebase/backend/common/log""github.com/bytebase/bytebase/backend/component/bus""github.com/bytebase/bytebase/backend/component/webhook"@@ -87,11 +88,17 @@ func (s *Scheduler) executeTaskRun(ctx context.Context, projectID string, taskRuProjectID: task.ProjectID,Updater: "",Status: storepb.TaskRun_FAILED,+ AllowedStatuses: []storepb.TaskRun_Status{+ storepb.TaskRun_RUNNING,+ },ResultProto: &storepb.TaskRunResult{Detail: err.Error(),},}if _, patchErr := s.store.UpdateTaskRunStatus(ctx, taskRunStatusPatch); patchErr != nil {+ if common.ErrorCode(patchErr) == common.Conflict {+ return nil+ }return errors.Wrapf(patchErr, "failed to mark task run as failed after drift detection")}return nil@@ -139,13 +146,19 @@ func (s *Scheduler) runTaskRunOnce(ctx context.Context, taskRunUID int64, task *log.BBError(err),)taskRunStatusPatch := &store.TaskRunStatusPatch{- ID: taskRunUID,- ProjectID: task.ProjectID,- Updater: "",- Status: storepb.TaskRun_CANCELED,+ ID: taskRunUID,+ ProjectID: task.ProjectID,+ Updater: "",+ Status: storepb.TaskRun_CANCELED,+ AllowedStatuses: []storepb.TaskRun_Status{+ storepb.TaskRun_RUNNING,+ },ResultProto: &storepb.TaskRunResult{},}if _, err := s.store.UpdateTaskRunStatus(ctx, taskRunStatusPatch); err != nil {+ if common.ErrorCode(err) == common.Conflict {+ return+ }slog.Error("Failed to mark task as CANCELED",slog.Int64("id", task.ID),log.BBError(err),@@ -166,11 +179,17 @@ func (s *Scheduler) runTaskRunOnce(ctx context.Context, taskRunUID int64, task *ProjectID: task.ProjectID,Updater: "",Status: storepb.TaskRun_FAILED,+ AllowedStatuses: []storepb.TaskRun_Status{+ storepb.TaskRun_RUNNING,+ },ResultProto: &storepb.TaskRunResult{Detail: err.Error(),},}if _, err := s.store.UpdateTaskRunStatus(ctx, taskRunStatusPatch); err != nil {+ if common.ErrorCode(err) == common.Conflict {+ return+ }slog.Error("Failed to mark task as FAILED",slog.Int64("id", task.ID),log.BBError(err),@@ -208,13 +227,19 @@ func (s *Scheduler) runTaskRunOnce(ctx context.Context, taskRunUID int64, task *// Success casetaskRunStatusPatch := &store.TaskRunStatusPatch{- ID: taskRunUID,- ProjectID: task.ProjectID,- Updater: "",- Status: storepb.TaskRun_DONE,+ ID: taskRunUID,+ ProjectID: task.ProjectID,+ Updater: "",+ Status: storepb.TaskRun_DONE,+ AllowedStatuses: []storepb.TaskRun_Status{+ storepb.TaskRun_RUNNING,+ },ResultProto: result,}if _, err := s.store.UpdateTaskRunStatus(ctx, taskRunStatusPatch); err != nil {+ if common.ErrorCode(err) == common.Conflict {+ return+ }slog.Error("Failed to mark task as DONE",slog.Int64("id", task.ID),log.BBError(err),diff --git a/backend/runner/taskrun/scheduler.go b/backend/runner/taskrun/scheduler.goindex 67d21899d4..9eba119e04 100644--- a/backend/runner/taskrun/scheduler.go+++ b/backend/runner/taskrun/scheduler.go@@ -8,6 +8,7 @@ import ("github.com/pkg/errors"+ "github.com/bytebase/bytebase/backend/common""github.com/bytebase/bytebase/backend/common/log""github.com/bytebase/bytebase/backend/component/bus""github.com/bytebase/bytebase/backend/component/config"@@ -92,10 +93,17 @@ func (s *Scheduler) failTaskRunsForHA(ctx context.Context, haErr error) {ID: taskRun.ID,ProjectID: taskRun.ProjectID,Status: storepb.TaskRun_FAILED,+ AllowedStatuses: []storepb.TaskRun_Status{+ storepb.TaskRun_PENDING,+ storepb.TaskRun_AVAILABLE,+ },ResultProto: &storepb.TaskRunResult{Detail: haErr.Error(),},}); err != nil {+ if common.ErrorCode(err) == common.Conflict {+ continue+ }slog.Error("failed to fail task run for HA limit",slog.Int64("taskRunID", taskRun.ID),log.BBError(err),diff --git a/backend/store/task_run.go b/backend/store/task_run.goindex 9db0031af4..d1579e9cdd 100644--- a/backend/store/task_run.go+++ b/backend/store/task_run.go@@ -55,8 +55,9 @@ type TaskRunStatusPatch struct {Updater string// Domain specific fields- Status storepb.TaskRun_Status- ResultProto *storepb.TaskRunResult+ Status storepb.TaskRun_Status+ AllowedStatuses []storepb.TaskRun_Status+ ResultProto *storepb.TaskRunResult}// ListTaskRuns lists task runs.@@ -431,8 +432,17 @@ func (*Store) patchTaskRunStatusImpl(ctx context.Context, txn *sql.Tx, patch *Ta}q := qb.Q().Space("UPDATE task_run SET ?", set).- Space("WHERE id = ? AND project = ?", patch.ID, patch.ProjectID).- Space("RETURNING id, creator, created_at, updated_at, task_id, status, result")+ Space("WHERE id = ? AND project = ?", patch.ID, patch.ProjectID)++ if len(patch.AllowedStatuses) > 0 {+ var statusStrings []string+ for _, status := range patch.AllowedStatuses {+ statusStrings = append(statusStrings, status.String())+ }+ q.Space("AND status = ANY(?)", statusStrings)+ }++ q.Space("RETURNING id, creator, created_at, updated_at, task_id, status, result")query, args, err := q.ToSQL()if err != nil {@@ -453,6 +463,9 @@ func (*Store) patchTaskRunStatusImpl(ctx context.Context, txn *sql.Tx, patch *Ta&resultJSON,); err != nil {if err == sql.ErrNoRows {+ if len(patch.AllowedStatuses) > 0 {+ return nil, &common.Error{Code: common.Conflict, Err: errors.Errorf("task run %d status changed", patch.ID)}+ }return nil, &common.Error{Code: common.NotFound, Err: errors.Errorf("project ID not found: %d", patch.ID)}}return nil, err@@ -473,7 +486,7 @@ func (*Store) patchTaskRunStatusImpl(ctx context.Context, txn *sql.Tx, patch *Tareturn &taskRun, nil}-// BatchCancelTaskRuns updates the status of taskRuns to CANCELED.+// BatchCancelTaskRuns updates non-running task runs to CANCELED.func (s *Store) BatchCancelTaskRuns(ctx context.Context, projectID string, taskRunIDs []int64) error {if len(taskRunIDs) == 0 {return nil@@ -482,7 +495,9 @@ func (s *Store) BatchCancelTaskRuns(ctx context.Context, projectID string, taskRUPDATE task_runSET status = ?, updated_at = now()WHERE id = ANY(?) AND project = ?- `, storepb.TaskRun_CANCELED.String(), taskRunIDs, projectID)+ AND status IN (?, ?)+ `, storepb.TaskRun_CANCELED.String(), taskRunIDs, projectID,+ storepb.TaskRun_PENDING.String(), storepb.TaskRun_AVAILABLE.String())query, args, err := q.ToSQL()if err != nil {diff --git a/frontend/src/react/locales/en-US.json b/frontend/src/react/locales/en-US.jsonindex 9a32d549f5..172c5a7983 100644--- a/frontend/src/react/locales/en-US.json+++ b/frontend/src/react/locales/en-US.json@@ -3720,6 +3720,7 @@"subscription.usage.instance-count.title": "Instance count limit","task": {"cancel-task": "Cancel task | Cancel tasks",+ "cancel-task-description": "Pending and available task runs are canceled immediately. Running task runs receive a best-effort cancel request and may keep running; retry if needed.","checking": "Checking...","created": "Created","data-export-creator-only": "Only the issue creator can execute data export tasks",diff --git a/frontend/src/react/locales/es-ES.json b/frontend/src/react/locales/es-ES.jsonindex 58bffb54d2..548f2be702 100644--- a/frontend/src/react/locales/es-ES.json+++ b/frontend/src/react/locales/es-ES.json@@ -3708,6 +3708,7 @@"subscription.usage.instance-count.title": "Límite de cantidad de instancias","task": {"cancel-task": "Cancelar tarea | Cancelar tareas",+ "cancel-task-description": "Las ejecuciones de tareas pendientes y disponibles se cancelan inmediatamente. Las ejecuciones en curso reciben una solicitud de cancelación de mejor esfuerzo y pueden seguir ejecutándose; vuelva a intentarlo si es necesario.","checking": "Comprobando...","created": "Creado","data-export-creator-only": "Sólo el creador del problema puede ejecutar tareas de exportación de datos",diff --git a/frontend/src/react/locales/ja-JP.json b/frontend/src/react/locales/ja-JP.jsonindex 9a25bdf8de..2e7a907592 100644--- a/frontend/src/react/locales/ja-JP.json+++ b/frontend/src/react/locales/ja-JP.json@@ -3708,6 +3708,7 @@"subscription.usage.instance-count.title": "インスタンスの制限","task": {"cancel-task": "タスクをキャンセルする",+ "cancel-task-description": "保留中および利用可能なタスク実行はすぐにキャンセルされます。実行中のタスク実行にはベストエフォートのキャンセル要求が送信されますが、実行が続く場合があります。必要に応じて再試行してください。","checking": "検査中…","created": "作成日時","data-export-creator-only": "イシュー作成者のみがデータエクスポートタスクを実行できます",diff --git a/frontend/src/react/locales/vi-VN.json b/frontend/src/react/locales/vi-VN.jsonindex 613ed5fd36..da9914ee1c 100644--- a/frontend/src/react/locales/vi-VN.json+++ b/frontend/src/react/locales/vi-VN.json@@ -3708,6 +3708,7 @@"subscription.usage.instance-count.title": "Giới hạn số lượng phiên bản","task": {"cancel-task": "Hủy tác vụ | Hủy các tác vụ",+ "cancel-task-description": "Các lần chạy tác vụ đang chờ và sẵn sàng sẽ được hủy ngay. Các lần chạy đang chạy sẽ nhận yêu cầu hủy theo cách cố gắng tối đa và có thể tiếp tục chạy; hãy thử lại nếu cần.","checking": "Đang kiểm tra...","created": "Đã tạo","data-export-creator-only": "Chỉ người tạo sự cố mới có thể thực hiện tác vụ xuất dữ liệu",diff --git a/frontend/src/react/locales/zh-CN.json b/frontend/src/react/locales/zh-CN.jsonindex 67af2e8b11..0dd05184ca 100644--- a/frontend/src/react/locales/zh-CN.json+++ b/frontend/src/react/locales/zh-CN.json@@ -3708,6 +3708,7 @@"subscription.usage.instance-count.title": "实例数量限制","task": {"cancel-task": "取消任务",+ "cancel-task-description": "待运行和就绪的任务运行会立即取消。运行中的任务运行会收到尽力而为的取消请求,可能会继续运行;如有需要请重试。","checking": "检查中…","created": "创建时间","data-export-creator-only": "只有工单创建者可以执行数据导出任务",diff --git a/frontend/src/react/pages/project/issue-detail/components/IssueDetailTaskRolloutActionPanel.tsx b/frontend/src/react/pages/project/issue-detail/components/IssueDetailTaskRolloutActionPanel.tsxindex 9b0b25d774..d3bb31038e 100644--- a/frontend/src/react/pages/project/issue-detail/components/IssueDetailTaskRolloutActionPanel.tsx+++ b/frontend/src/react/pages/project/issue-detail/components/IssueDetailTaskRolloutActionPanel.tsx@@ -373,6 +373,12 @@ export function IssueDetailTaskRolloutActionPanel({</div>)}+ {action === "CANCEL" && (+ <p className="text-sm text-control-light">+ {t("task.cancel-task-description")}+ </p>+ )}+{action === "RUN" && (<div className="flex flex-col"><h3 className="mb-1 font-medium text-control">@@ -544,6 +550,7 @@ async function cancelTasks({return (taskNames.has(taskName) &&(run.status === TaskRun_Status.PENDING ||+ run.status === TaskRun_Status.AVAILABLE ||run.status === TaskRun_Status.RUNNING));})diff --git a/frontend/src/react/pages/project/plan-detail/components/PlanDetailTaskRolloutActionPanel.tsx b/frontend/src/react/pages/project/plan-detail/components/PlanDetailTaskRolloutActionPanel.tsxindex 479f8936b0..0659c4c945 100644--- a/frontend/src/react/pages/project/plan-detail/components/PlanDetailTaskRolloutActionPanel.tsx+++ b/frontend/src/react/pages/project/plan-detail/components/PlanDetailTaskRolloutActionPanel.tsx@@ -362,6 +362,12 @@ export function PlanDetailTaskRolloutActionPanel({</div>)}+ {action === "CANCEL" && (+ <p className="text-sm text-control-light">+ {t("task.cancel-task-description")}+ </p>+ )}+{action === "RUN" && (<div className="flex flex-col"><h3 className="mb-1 font-medium text-control">@@ -543,6 +549,7 @@ async function cancelTasks({return (taskNames.has(taskName) &&(run.status === TaskRun_Status.PENDING ||+ run.status === TaskRun_Status.AVAILABLE ||run.status === TaskRun_Status.RUNNING));})diff --git a/frontend/src/react/pages/project/plan-detail/components/deploy/DeployStageContentSidebar.tsx b/frontend/src/react/pages/project/plan-detail/components/deploy/DeployStageContentSidebar.tsxindex e69802ceaa..5587646fd2 100644--- a/frontend/src/react/pages/project/plan-detail/components/deploy/DeployStageContentSidebar.tsx+++ b/frontend/src/react/pages/project/plan-detail/components/deploy/DeployStageContentSidebar.tsx@@ -160,7 +160,8 @@ export function DeployStageContentSidebar({ stage }: { stage: Stage }) {? Task_Status.FAILED: taskRun.status === TaskRun_Status.RUNNING? Task_Status.RUNNING- : taskRun.status === TaskRun_Status.PENDING+ : taskRun.status === TaskRun_Status.PENDING ||+ taskRun.status === TaskRun_Status.AVAILABLE? Task_Status.PENDING: Task_Status.CANCELED}diff --git a/frontend/src/types/proto-es/v1/rollout_service_pb.d.ts b/frontend/src/types/proto-es/v1/rollout_service_pb.d.tsindex 641bbfeabb..b9b6c21a5f 100644--- a/frontend/src/types/proto-es/v1/rollout_service_pb.d.ts+++ b/frontend/src/types/proto-es/v1/rollout_service_pb.d.ts@@ -1985,7 +1985,10 @@ export declare const RolloutService: GenService<{output: typeof BatchSkipTasksResponseSchema;},/**- * Cancels multiple running task executions.+ * Cancels multiple task runs.+ * PENDING and AVAILABLE task runs are moved to CANCELED synchronously. RUNNING task runs receive+ * a best-effort cancellation request and may continue running if the request is missed or the+ * executor does not stop. The response does not report which task runs were actually canceled.* Permissions required: bb.taskRuns.create (or issue creator for data export issues, or user with rollout policy role for the environment)** @generated from rpc bytebase.v1.RolloutService.BatchCancelTaskRunsdiff --git a/proto/gen/grpc-doc/openapi.yaml b/proto/gen/grpc-doc/openapi.yamlindex c3db5c305b..55d0309ce3 100644--- a/proto/gen/grpc-doc/openapi.yaml+++ b/proto/gen/grpc-doc/openapi.yaml@@ -9860,7 +9860,10 @@ paths:- RolloutServicesummary: BatchCancelTaskRunsdescription: |-- Cancels multiple running task executions.+ Cancels multiple task runs.+ PENDING and AVAILABLE task runs are moved to CANCELED synchronously. RUNNING task runs receive+ a best-effort cancellation request and may continue running if the request is missed or the+ executor does not stop. The response does not report which task runs were actually canceled.Permissions required: bb.taskRuns.create (or issue creator for data export issues, or user with rollout policy role for the environment)operationId: RolloutService_BatchCancelTaskRunsparameters:diff --git a/proto/gen/grpc-doc/v1/README.md b/proto/gen/grpc-doc/v1/README.mdindex 5a3fae7bbe..d68a26db29 100644--- a/proto/gen/grpc-doc/v1/README.md+++ b/proto/gen/grpc-doc/v1/README.md@@ -2134,7 +2134,7 @@ RolloutService manages the execution of deployment plans.| GetTaskRunSession | [GetTaskRunSessionRequest](#bytebase-v1-GetTaskRunSessionRequest) | [TaskRunSession](#bytebase-v1-TaskRunSession) | Retrieves database session information for a running task. Permissions required: bb.taskRuns.list || BatchRunTasks | [BatchRunTasksRequest](#bytebase-v1-BatchRunTasksRequest) | [BatchRunTasksResponse](#bytebase-v1-BatchRunTasksResponse) | Executes multiple tasks in a rollout stage. Permissions required: bb.taskRuns.create (or issue creator for data export issues, or user with rollout policy role for the environment) || BatchSkipTasks | [BatchSkipTasksRequest](#bytebase-v1-BatchSkipTasksRequest) | [BatchSkipTasksResponse](#bytebase-v1-BatchSkipTasksResponse) | Skips multiple tasks in a rollout stage. Permissions required: bb.taskRuns.create (or issue creator for data export issues, or user with rollout policy role for the environment) |-| BatchCancelTaskRuns | [BatchCancelTaskRunsRequest](#bytebase-v1-BatchCancelTaskRunsRequest) | [BatchCancelTaskRunsResponse](#bytebase-v1-BatchCancelTaskRunsResponse) | Cancels multiple running task executions. Permissions required: bb.taskRuns.create (or issue creator for data export issues, or user with rollout policy role for the environment) |+| BatchCancelTaskRuns | [BatchCancelTaskRunsRequest](#bytebase-v1-BatchCancelTaskRunsRequest) | [BatchCancelTaskRunsResponse](#bytebase-v1-BatchCancelTaskRunsResponse) | Cancels multiple task runs. PENDING and AVAILABLE task runs are moved to CANCELED synchronously. RUNNING task runs receive a best-effort cancellation request and may continue running if the request is missed or the executor does not stop. The response does not report which task runs were actually canceled. Permissions required: bb.taskRuns.create (or issue creator for data export issues, or user with rollout policy role for the environment) || PreviewTaskRunRollback | [PreviewTaskRunRollbackRequest](#bytebase-v1-PreviewTaskRunRollbackRequest) | [PreviewTaskRunRollbackResponse](#bytebase-v1-PreviewTaskRunRollbackResponse) | Generates rollback SQL for a completed task run. Permissions required: bb.taskRuns.list |diff --git a/proto/gen/grpc-doc/v1/index.html b/proto/gen/grpc-doc/v1/index.htmlindex 26d054207c..2cc5e14227 100644--- a/proto/gen/grpc-doc/v1/index.html+++ b/proto/gen/grpc-doc/v1/index.html@@ -6635,7 +6635,10 @@ Permissions required: bb.taskRuns.create (or issue creator for data export issue<td>BatchCancelTaskRuns</td><td><a href="#bytebase.v1.BatchCancelTaskRunsRequest">BatchCancelTaskRunsRequest</a></td><td><a href="#bytebase.v1.BatchCancelTaskRunsResponse">BatchCancelTaskRunsResponse</a></td>- <td><p>Cancels multiple running task executions.+ <td><p>Cancels multiple task runs.+PENDING and AVAILABLE task runs are moved to CANCELED synchronously. RUNNING task runs receive+a best-effort cancellation request and may continue running if the request is missed or the+executor does not stop. The response does not report which task runs were actually canceled.Permissions required: bb.taskRuns.create (or issue creator for data export issues, or user with rollout policy role for the environment)</p></td></tr>diff --git a/proto/v1/v1/rollout_service.proto b/proto/v1/v1/rollout_service.protoindex 649df4a904..8f5f5f4e6e 100644--- a/proto/v1/v1/rollout_service.proto+++ b/proto/v1/v1/rollout_service.proto@@ -105,7 +105,10 @@ service RolloutService {option (bytebase.v1.audit) = true;}- // Cancels multiple running task executions.+ // Cancels multiple task runs.+ // PENDING and AVAILABLE task runs are moved to CANCELED synchronously. RUNNING task runs receive+ // a best-effort cancellation request and may continue running if the request is missed or the+ // executor does not stop. The response does not report which task runs were actually canceled.// Permissions required: bb.taskRuns.create (or issue creator for data export issues, or user with rollout policy role for the environment)rpc BatchCancelTaskRuns(BatchCancelTaskRunsRequest) returns (BatchCancelTaskRunsResponse) {option (google.api.http) = {