From aea3c6fe66786cf821ec9192f37df89a1b361143 Mon Sep 17 00:00:00 2001 From: Dery Rahman Ahaddienata Date: Mon, 30 Sep 2024 20:17:21 +0700 Subject: [PATCH] feat: terminate the job as well when fail to fetch log --- max2max/internal/client/odps.go | 1 + 1 file changed, 1 insertion(+) diff --git a/max2max/internal/client/odps.go b/max2max/internal/client/odps.go index c0980a0..1712eba 100644 --- a/max2max/internal/client/odps.go +++ b/max2max/internal/client/odps.go @@ -35,6 +35,7 @@ func (c *odpsClient) ExecSQL(ctx context.Context, query string) error { // generate log view url, err := odps.NewLogView(c.client).GenerateLogView(taskIns, 1) if err != nil { + err = e.Join(err, taskIns.Terminate()) return errors.WithStack(err) } c.logger.Info(fmt.Sprintf("log view: %s", url))