Skip to content

Commit

Permalink
fix(go/adbc/driver/flightsql): take metadata lock for safety (#1228)
Browse files Browse the repository at this point in the history
Fixes #1178.
  • Loading branch information
lidavidm authored Oct 26, 2023
1 parent 4a34896 commit 1bd874b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion go/adbc/driver/flightsql/flightsql_database.go
Original file line number Diff line number Diff line change
Expand Up @@ -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])
}
}
Expand Down

0 comments on commit 1bd874b

Please sign in to comment.