Skip to content

Database governance built for humans and agents — controlling changes and access across every major database.

fix: syncError may be blocking (#1717)

p0ny1c1793fb0cb7
diff --git a/server/task_executor_schema_update_ghost_sync.go b/server/task_executor_schema_update_ghost_sync.go
index 08ca7dbe62..72962676bf 100644
--- a/server/task_executor_schema_update_ghost_sync.go
+++ b/server/task_executor_schema_update_ghost_sync.go
@@ -164,7 +164,12 @@ func runGhostMigration(ctx context.Context, server *Server, task *api.Task, stat
migrationID, schema, err := executeSync(ctx, task, mi, statement, syncDone)
if err != nil {
log.Error("failed to execute schema update gh-ost sync executeSync", zap.Error(err))
- syncError <- fmt.Errorf("failed to execute schema update gh-ost sync executeSync, error: %w", err)
+ // There could be an error in gh-ost migration after the syncDone channel returns which causes the outer function returns, too.
+ // Then there's no consumer of syncError, so we must make sending to syncError non-blocking.
+ select {
+ case syncError <- fmt.Errorf("failed to execute schema update gh-ost sync executeSync, error: %w", err):
+ default:
+ }
return
}
_, _, err = postMigration(ctx, server, task, vcsPushEvent, mi, migrationID, schema)