xborder commented on code in PR #4322:
URL: https://github.com/apache/arrow-adbc/pull/4322#discussion_r3277681888


##########
go/adbc/driver/flightsql/flightsql_database.go:
##########
@@ -430,15 +486,47 @@ func getFlightClient(ctx context.Context, loc string, d 
*databaseImpl, authMiddl
        var authValue string
 
        if d.user != "" || d.pass != "" {
+               // Emit start/finish logs around basic auth so an operator can
+               // distinguish "the driver never tried to authenticate" from
+               // "authentication started but the server never responded" — the
+               // two have very different root causes (option not threaded vs
+               // network/TLS/server fault).
+               authStart := time.Now()
+               d.Logger.InfoContext(ctx, "FlightSQL basic auth started",
+                       "target", loc,
+                       "user", d.user,
+               )
                var header, trailer metadata.MD
                ctx, err = cl.Client.AuthenticateBasicToken(ctx, d.user, 
d.pass, grpc.Header(&header), grpc.Trailer(&trailer), d.timeout)
                if err != nil {
+                       args := []any{
+                               "target", loc,
+                               "user", d.user,
+                               "duration", time.Since(authStart),
+                               "err", err,
+                       }
+                       args = append(args, correlationHeaderAttrs(header)...)
+                       args = append(args, correlationHeaderAttrs(trailer)...)
+                       args = append(args, grpcStatusAttrs(err)...)
+                       d.Logger.InfoContext(ctx, "FlightSQL basic auth 
failed", args...)

Review Comment:
   should this be error? debug?



##########
go/adbc/driver/flightsql/flightsql_database.go:
##########
@@ -430,15 +486,47 @@ func getFlightClient(ctx context.Context, loc string, d 
*databaseImpl, authMiddl
        var authValue string
 
        if d.user != "" || d.pass != "" {
+               // Emit start/finish logs around basic auth so an operator can
+               // distinguish "the driver never tried to authenticate" from
+               // "authentication started but the server never responded" — the
+               // two have very different root causes (option not threaded vs
+               // network/TLS/server fault).
+               authStart := time.Now()
+               d.Logger.InfoContext(ctx, "FlightSQL basic auth started",
+                       "target", loc,
+                       "user", d.user,
+               )
                var header, trailer metadata.MD
                ctx, err = cl.Client.AuthenticateBasicToken(ctx, d.user, 
d.pass, grpc.Header(&header), grpc.Trailer(&trailer), d.timeout)
                if err != nil {
+                       args := []any{
+                               "target", loc,
+                               "user", d.user,
+                               "duration", time.Since(authStart),
+                               "err", err,
+                       }
+                       args = append(args, correlationHeaderAttrs(header)...)
+                       args = append(args, correlationHeaderAttrs(trailer)...)
+                       args = append(args, grpcStatusAttrs(err)...)
+                       d.Logger.InfoContext(ctx, "FlightSQL basic auth 
failed", args...)

Review Comment:
   should this be error? debug?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to