This is an automated email from the ASF dual-hosted git repository.

lidavidm pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/arrow-adbc.git


The following commit(s) were added to refs/heads/main by this push:
     new 1bd874b8 fix(go/adbc/driver/flightsql): take metadata lock for safety 
(#1228)
1bd874b8 is described below

commit 1bd874b8e9d4359e5ca5f86f0111b724cfc5d299
Author: David Li <[email protected]>
AuthorDate: Thu Oct 26 13:06:00 2023 -0400

    fix(go/adbc/driver/flightsql): take metadata lock for safety (#1228)
    
    Fixes #1178.
---
 go/adbc/driver/flightsql/flightsql_database.go | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/go/adbc/driver/flightsql/flightsql_database.go 
b/go/adbc/driver/flightsql/flightsql_database.go
index 250a2f04..b671c8a8 100644
--- a/go/adbc/driver/flightsql/flightsql_database.go
+++ b/go/adbc/driver/flightsql/flightsql_database.go
@@ -382,7 +382,8 @@ func getFlightClient(ctx context.Context, loc string, d 
*databaseImpl) (*flights
                }
 
                if md, ok := metadata.FromOutgoingContext(ctx); ok {
-                       // No need to worry about lock here since we are sole 
owner
+                       authMiddle.mutex.Lock()
+                       defer authMiddle.mutex.Unlock()
                        authMiddle.hdrs.Set("authorization", 
md.Get("Authorization")[0])
                }
        }

Reply via email to