From 896ad4c9ca5f7e93b632a3ad735459287f1c2d2c Mon Sep 17 00:00:00 2001 From: Dery Rahman Ahaddienata Date: Wed, 16 Apr 2025 15:56:16 +0700 Subject: [PATCH 1/2] refactor: enhance log with task id --- mc2mc/internal/client/odps.go | 1 + 1 file changed, 1 insertion(+) diff --git a/mc2mc/internal/client/odps.go b/mc2mc/internal/client/odps.go index a483f1b..df59e14 100644 --- a/mc2mc/internal/client/odps.go +++ b/mc2mc/internal/client/odps.go @@ -118,6 +118,7 @@ func (c *odpsClient) wait(taskIns *odps.Instance) <-chan error { defer close(errChan) err := c.retry(taskIns.WaitForSuccess) if err != nil { + err := errors.Wrap(err, fmt.Sprintf("task instance %s failed", taskIns.Id())) errChan <- errors.WithStack(err) } c.logger.Info(fmt.Sprintf("task instance %s finished with status: %s", taskIns.Id(), taskIns.Status())) From caf5f2b9cd7070f0dd354a402806e10279c052f0 Mon Sep 17 00:00:00 2001 From: Dery Rahman Ahaddienata Date: Wed, 16 Apr 2025 15:58:10 +0700 Subject: [PATCH 2/2] fix: remove comma to avoid broken url --- mc2mc/internal/client/odps.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mc2mc/internal/client/odps.go b/mc2mc/internal/client/odps.go index df59e14..ceafa60 100644 --- a/mc2mc/internal/client/odps.go +++ b/mc2mc/internal/client/odps.go @@ -51,7 +51,7 @@ func (c *odpsClient) ExecSQL(ctx context.Context, query string, additionalHints err = e.Join(err, taskIns.Terminate()) return errors.WithStack(err) } - c.logger.Info(fmt.Sprintf("taskId: %s, log view: %s, hints: (%s)", taskIns.Id(), url, getHintsString(hints))) + c.logger.Info(fmt.Sprintf("taskId: %s, log view: %s , hints: (%s)", taskIns.Id(), url, getHintsString(hints))) // wait execution success select {