Closed Cooksauce closed 4 months ago
This looks like a user-facing issue due to https://github.com/GoogleCloudPlatform/cloud-sql-go-connector/issues/771.
If I understand that linked issue correctly, it's a caching issue?
Does that still explain the 30s hang happening every time a postgres client connects to the proxy? Even subsequent connects of the same client as the same user to the same running cloud-sql-proxy instance hangs for another 30s.
Yes, it has to do with how the internal rate limiter works -- or in this case, not working.
We're seeing this in a separate place too now. I'll get this fixed.
This is definitely caused by https://github.com/GoogleCloudPlatform/cloud-sql-go-connector/issues/771. Closing it as a duplicate. I have a fix that I'll put up today.
Since we'll need to upgrade cloudsqlconn here, let's use https://github.com/GoogleCloudPlatform/cloud-sql-proxy/issues/2224 as the tracking issue.
Confirmed v2.11.3
fixes this issue
ref: https://github.com/GoogleCloudPlatform/cloud-sql-proxy/issues/2212#issuecomment-2135816591
Bug Description
When using token auth with IAM (e.g.
--auto-iam-authn --token --login-token
), the proxy takes an unreasonably long time to do the IAM postgres authentication. This can be seen in the logs attached when using--run-connection-test
.This long delay also happens each time a postgres client tries to access the db thru the proxy - including subsequent accesses. E.g.
psql ...
takes 30s+ to get into thepostgres>
replThe same behavior is not observed when authenticating via Application Default Credentials.
Example code (or command)
No response
Stacktrace
No response
Steps to reproduce?
gcloud auth login
Environment
./cloud-sql-proxy --version
):2.10.1
./cloud-sql-proxy --port 5432 INSTANCE_CONNECTION_NAME
):Additional Details
Debug Logs:
Using ADC:
Notice the connection test passes immediately
Using Manual Access Tokens
Notice the connection test takes 30s to pass