Skip to content

Commit 936a2ad

Browse files
committed
fix: propagate context cancellation in tenant schedule queries
Return immediately with the context error when a per-schema query fails due to context.Canceled or context.DeadlineExceeded, rather than silently treating it as a schema-level failure.
1 parent d4b293b commit 936a2ad

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

services/control-plane/internal/scheduling/provider.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,9 @@ func (r *GormTenantScheduleRepository) ListEnabledSchedules(ctx context.Context)
118118
Where("enabled = ?", true).
119119
Find(&entities).Error
120120
if err != nil {
121+
if errors.Is(err, context.Canceled) || errors.Is(err, context.DeadlineExceeded) {
122+
return nil, fmt.Errorf("query tenant schedules for schema %q: %w", schema, err)
123+
}
121124
r.logger.Error("failed to query tenant schedules",
122125
"schema", schema, "error", err)
123126
failedSchemas++

0 commit comments

Comments
 (0)