This is an automated email from the ASF dual-hosted git repository.

warren pushed a commit to branch fix/silent-error-handling
in repository https://gitbox.apache.org/repos/asf/incubator-devlake.git

commit 3cf995c062d2b2dbd3f25df979b80891b6da3b22
Author: warren <[email protected]>
AuthorDate: Mon Mar 16 00:19:42 2026 +0800

    fix: handle silently ignored errors in migration helper and pipeline cancel
    
    In AutoMigrateTables, properly handle db.First errors instead of silently
    discarding them — NotFound is expected for empty tables but other errors
    should be surfaced. In CancelPipeline, log task cancellation failures
    instead of silently ignoring them.
---
 backend/helpers/migrationhelper/migrationhelper.go | 6 +++++-
 backend/server/services/pipeline.go                | 6 ++++--
 2 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/backend/helpers/migrationhelper/migrationhelper.go 
b/backend/helpers/migrationhelper/migrationhelper.go
index 24eb537a7..a1cf551fe 100644
--- a/backend/helpers/migrationhelper/migrationhelper.go
+++ b/backend/helpers/migrationhelper/migrationhelper.go
@@ -40,7 +40,11 @@ func AutoMigrateTables(basicRes context.BasicRes, dst 
...interface{}) errors.Err
                if err != nil {
                        return err
                }
-               _ = db.First(entity)
+               // Load one record to verify the table is readable after 
migration.
+               // NotFound is expected for empty tables and can be safely 
ignored.
+               if err = db.First(entity); err != nil && 
!db.IsErrorNotFound(err) {
+                       return errors.Default.Wrap(err, "failed to verify table 
after migration")
+               }
        }
        return nil
 }
diff --git a/backend/server/services/pipeline.go 
b/backend/server/services/pipeline.go
index f6c770f9c..cfd7769df 100644
--- a/backend/server/services/pipeline.go
+++ b/backend/server/services/pipeline.go
@@ -462,9 +462,11 @@ func CancelPipeline(pipelineId uint64) errors.Error {
                return nil
        }
        for _, pendingTask := range pendingTasks {
-               _ = CancelTask(pendingTask.ID)
+               if cancelErr := CancelTask(pendingTask.ID); cancelErr != nil {
+                       globalPipelineLog.Error(cancelErr, "failed to cancel 
task #%d of pipeline #%d", pendingTask.ID, pipelineId)
+               }
        }
-       return errors.Convert(err)
+       return nil
 }
 
 // getPipelineLogsPath gets the logs directory of this pipeline

Reply via email to