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

abeizn pushed a commit to branch release-v0.14
in repository https://gitbox.apache.org/repos/asf/incubator-devlake.git


The following commit(s) were added to refs/heads/release-v0.14 by this push:
     new 6a216b0a5 fix: dbt zombie processes (#3921)
6a216b0a5 is described below

commit 6a216b0a5b912a9eeca78dc2dd114b37a0357e74
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 d6eb60b58..b469d6244 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