mirror of https://github.com/databricks/cli.git
add debug logs
This commit is contained in:
parent
0e300c6a40
commit
da7e9e23ca
|
@ -1 +1,10 @@
|
|||
error: upload did not succeed after three attempts. err: &retries.Err{Err:(*apierr.APIError)(0x14000361540), Halt:true}. response body: (*telemetry.ResponseBody)(nil)
|
||||
attempt 0:
|
||||
err: Endpoint not implemented.
|
||||
response body: (*telemetry.ResponseBody)(nil)
|
||||
attempt 1:
|
||||
err: Endpoint not implemented.
|
||||
response body: (*telemetry.ResponseBody)(nil)
|
||||
attempt 2:
|
||||
err: Endpoint not implemented.
|
||||
response body: (*telemetry.ResponseBody)(nil)
|
||||
error: upload did not succeed after three attempts
|
||||
|
|
|
@ -1 +1,10 @@
|
|||
error: upload did not succeed after three attempts. err: <nil>. response body: &telemetry.ResponseBody{Errors:[]telemetry.LogError{}, NumProtoSuccess:1}
|
||||
attempt 0:
|
||||
err: %!s(<nil>)
|
||||
response body: &telemetry.ResponseBody{Errors:[]telemetry.LogError{}, NumProtoSuccess:1}
|
||||
attempt 1:
|
||||
err: %!s(<nil>)
|
||||
response body: &telemetry.ResponseBody{Errors:[]telemetry.LogError{}, NumProtoSuccess:1}
|
||||
attempt 2:
|
||||
err: %!s(<nil>)
|
||||
response body: &telemetry.ResponseBody{Errors:[]telemetry.LogError{}, NumProtoSuccess:1}
|
||||
error: upload did not succeed after three attempts
|
||||
|
|
|
@ -79,7 +79,7 @@ func Upload(ctx context.Context) (*ResponseBody, error) {
|
|||
var resp *ResponseBody
|
||||
|
||||
// Only try uploading logs for a maximum of 3 times.
|
||||
for range 3 {
|
||||
for i := range 3 {
|
||||
// TODO: Confirm that the timeout of a request here is indeed one minute.
|
||||
resp, err = attempt(ctx, apiClient, logs)
|
||||
|
||||
|
@ -88,6 +88,10 @@ func Upload(ctx context.Context) (*ResponseBody, error) {
|
|||
return resp, nil
|
||||
}
|
||||
|
||||
fmt.Fprintf(os.Stderr, "attempt %d:\n", i)
|
||||
fmt.Fprintf(os.Stderr, "err: %s\n", err)
|
||||
fmt.Fprintf(os.Stderr, "response body: %#v\n", resp)
|
||||
|
||||
// Partial success. Retry.
|
||||
if err == nil && resp.NumProtoSuccess < int64(len(logs)) {
|
||||
time.Sleep(2 * time.Second)
|
||||
|
@ -104,7 +108,7 @@ func Upload(ctx context.Context) (*ResponseBody, error) {
|
|||
}
|
||||
}
|
||||
|
||||
return resp, fmt.Errorf("upload did not succeed after three attempts. err: %#v. response body: %#v", err, resp)
|
||||
return resp, errors.New("upload did not succeed after three attempts")
|
||||
}
|
||||
|
||||
func attempt(ctx context.Context, apiClient *client.DatabricksClient, protoLogs []string) (*ResponseBody, error) {
|
||||
|
|
Loading…
Reference in New Issue