From dab957d05e215170aff74bcb5cd0a1d6c8357997 Mon Sep 17 00:00:00 2001 From: Shreyas Goenka Date: Wed, 5 Mar 2025 13:58:14 +0100 Subject: [PATCH] - --- .../out.upload_process.txt | 34 +++++++++---------- .../upload-fails/out.upload_process.txt | 4 +-- .../out.upload_process.txt | 4 +-- libs/telemetry/upload.go | 4 +-- 4 files changed, 23 insertions(+), 23 deletions(-) diff --git a/acceptance/telemetry/upload-fails-with-debug-logs/out.upload_process.txt b/acceptance/telemetry/upload-fails-with-debug-logs/out.upload_process.txt index 9ef8363f7..902a64cf3 100644 --- a/acceptance/telemetry/upload-fails-with-debug-logs/out.upload_process.txt +++ b/acceptance/telemetry/upload-fails-with-debug-logs/out.upload_process.txt @@ -14,23 +14,6 @@ HH:MM:SS Debug: POST /telemetry-ext < "message": "Endpoint not implemented." < } pid=PID sdk=true HH:MM:SS Debug: non-retriable error: Endpoint not implemented. pid=PID sdk=true -HH:MM:SS Warn: Attempt 0 failed due to a server side error. Retrying status code: 501 - pid=PID -HH:MM:SS Debug: POST /telemetry-ext -> { -> "items": null, -> "protoLogs": [ -> "{\"frontend_log_event_id\":\"[UUID]\",\"entry\":{\"databricks_cli_log\":{\"... (246 more bytes)", -> "{\"frontend_log_event_id\":\"[UUID]\",\"entry\":{\"databricks_cli_log\":{\"... (246 more bytes)" -> ], -> "uploadTime": "UNIX_TIME_MILLIS" -> } -< HTTP/1.1 501 Not Implemented -< { -< "error_code": "ERROR_CODE", -< "message": "Endpoint not implemented." -< } pid=PID sdk=true -HH:MM:SS Debug: non-retriable error: Endpoint not implemented. pid=PID sdk=true HH:MM:SS Warn: Attempt 1 failed due to a server side error. Retrying status code: 501 pid=PID HH:MM:SS Debug: POST /telemetry-ext @@ -50,4 +33,21 @@ HH:MM:SS Debug: POST /telemetry-ext HH:MM:SS Debug: non-retriable error: Endpoint not implemented. pid=PID sdk=true HH:MM:SS Warn: Attempt 2 failed due to a server side error. Retrying status code: 501 pid=PID +HH:MM:SS Debug: POST /telemetry-ext +> { +> "items": null, +> "protoLogs": [ +> "{\"frontend_log_event_id\":\"[UUID]\",\"entry\":{\"databricks_cli_log\":{\"... (246 more bytes)", +> "{\"frontend_log_event_id\":\"[UUID]\",\"entry\":{\"databricks_cli_log\":{\"... (246 more bytes)" +> ], +> "uploadTime": "UNIX_TIME_MILLIS" +> } +< HTTP/1.1 501 Not Implemented +< { +< "error_code": "ERROR_CODE", +< "message": "Endpoint not implemented." +< } pid=PID sdk=true +HH:MM:SS Debug: non-retriable error: Endpoint not implemented. pid=PID sdk=true +HH:MM:SS Warn: Attempt 3 failed due to a server side error. Retrying status code: 501 + pid=PID HH:MM:SS Error: upload did not succeed after three attempts pid=PID diff --git a/acceptance/telemetry/upload-fails/out.upload_process.txt b/acceptance/telemetry/upload-fails/out.upload_process.txt index 2ddd7a2b3..53aaa8ae1 100644 --- a/acceptance/telemetry/upload-fails/out.upload_process.txt +++ b/acceptance/telemetry/upload-fails/out.upload_process.txt @@ -1,7 +1,7 @@ -Warn: Attempt 0 failed due to a server side error. Retrying status code: 501 - Warn: Attempt 1 failed due to a server side error. Retrying status code: 501 Warn: Attempt 2 failed due to a server side error. Retrying status code: 501 +Warn: Attempt 3 failed due to a server side error. Retrying status code: 501 + Error: upload did not succeed after three attempts diff --git a/acceptance/telemetry/upload-partially-succeeds/out.upload_process.txt b/acceptance/telemetry/upload-partially-succeeds/out.upload_process.txt index 8682e10d4..a56a97213 100644 --- a/acceptance/telemetry/upload-partially-succeeds/out.upload_process.txt +++ b/acceptance/telemetry/upload-partially-succeeds/out.upload_process.txt @@ -1,7 +1,7 @@ -Warn: Attempt 0 was a partial success. Number of logs uploaded: 1 out of 2 - Warn: Attempt 1 was a partial success. Number of logs uploaded: 1 out of 2 Warn: Attempt 2 was a partial success. Number of logs uploaded: 1 out of 2 +Warn: Attempt 3 was a partial success. Number of logs uploaded: 1 out of 2 + Error: upload did not succeed after three attempts diff --git a/libs/telemetry/upload.go b/libs/telemetry/upload.go index 463df45aa..6c31df261 100644 --- a/libs/telemetry/upload.go +++ b/libs/telemetry/upload.go @@ -92,7 +92,7 @@ func Upload(ctx context.Context) (*ResponseBody, error) { // Partial success. Retry. if err == nil && resp.NumProtoSuccess < int64(len(logs)) { - log.Warnf(ctx, "Attempt %d was a partial success. Number of logs uploaded: %d out of %d\n", i, resp.NumProtoSuccess, len(logs)) + log.Warnf(ctx, "Attempt %d was a partial success. Number of logs uploaded: %d out of %d\n", i+1, resp.NumProtoSuccess, len(logs)) time.Sleep(2 * time.Second) continue } @@ -102,7 +102,7 @@ func Upload(ctx context.Context) (*ResponseBody, error) { // ref: https://github.com/databricks/databricks-sdk-go/blob/cdb28002afacb8b762348534a4c4040a9f19c24b/apierr/errors.go#L91 var apiErr *apierr.APIError if errors.As(err, &apiErr) && apiErr.StatusCode >= 500 && apiErr.StatusCode != 503 { - log.Warnf(ctx, "Attempt %d failed due to a server side error. Retrying status code: %d\n", i, apiErr.StatusCode) + log.Warnf(ctx, "Attempt %d failed due to a server side error. Retrying status code: %d\n", i+1, apiErr.StatusCode) time.Sleep(2 * time.Second) continue }