Fixed race condition with IAM Postgres Driver #2776
This PR addresses the issue of having a shared state. This was detected by running
The use of a mutex fixed the opportunity to read and write at the same time. Since the context of the mutex is kept extremely small there is no expected impact or deadlocks.
Add any steps or code to run in this section to help others prepare to run your code:
cd pkg/iampostgres/ go test -race -v .
Code Review Verification Steps
@@ Coverage Diff @@ ## master #2776 +/- ## ======================================== + Coverage 57.6% 57.6% +0.1% ======================================== Files 278 278 Lines 12567 12573 +6 ======================================== + Hits 7233 7239 +6 Misses 4586 4586 Partials 748 748