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


##########
go/adbc/driver/flightsql/flightsql_database.go:
##########
@@ -574,13 +700,46 @@ func (b *bearerAuthMiddleware) HeadersReceived(ctx 
context.Context, md metadata.
        headers := md.Get("authorization")
        if len(headers) > 0 {
                b.mutex.Lock()
-               defer b.mutex.Unlock()

Review Comment:
   Good call — switched back to defer Unlock(). Both methods now go through a 
small rotateAuth(headers ...) (previous []string, logger *slog.Logger) helper 
that holds the mutex with defer b.mutex.Unlock(), mutates b.hdrs, and returns a 
snapshot of the previous auth value plus the current logger. The structured log 
emission happens in HeadersReceived / SetHeader outside the critical section so 
we don't hold the lock across the slog call.



-- 
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