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

klesh pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/incubator-devlake.git


The following commit(s) were added to refs/heads/main by this push:
     new c316acd50 fix: dbt zombie processes (#3921)
c316acd50 is described below

commit c316acd507044667800b150a7c82c37dec3b98f0
Author: abeizn <[email protected]>
AuthorDate: Tue Dec 13 17:37:37 2022 +0800

    fix: dbt zombie processes (#3921)
    
    * fix: dbt zombie processes
    
    * fix: dbt zombie processes
---
 plugins/dbt/tasks/convertor.go | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/plugins/dbt/tasks/convertor.go b/plugins/dbt/tasks/convertor.go
index 511895ceb..04795aae8 100644
--- a/plugins/dbt/tasks/convertor.go
+++ b/plugins/dbt/tasks/convertor.go
@@ -184,6 +184,9 @@ func DbtConverter(taskCtx core.SubTaskContext) errors.Error 
{
        if err != nil {
                return err
        }
+       // prevent zombie process
+       defer cmd.Wait() //nolint
+
        scanner := bufio.NewScanner(stdout)
        var errStr string
        for scanner.Scan() {
@@ -199,10 +202,7 @@ func DbtConverter(taskCtx core.SubTaskContext) 
errors.Error {
        if err := errors.Convert(scanner.Err()); err != nil {
                return err
        }
-       err = errors.Convert(cmd.Wait())
-       if err != nil {
-               return errors.Internal.New(errStr)
-       }
+
        if !cmd.ProcessState.Success() {
                log.Error(nil, "dbt run task error, please check!!!")
        }

Reply via email to