Skip to content

GCP auth: resilient metadata token refresh with proper signal masking#384

Open
s1dd54rt5 wants to merge 1 commit into
Snowflake-Labs:mainfrom
s1dd54rt5:gcp-auth-enhancements
Open

GCP auth: resilient metadata token refresh with proper signal masking#384
s1dd54rt5 wants to merge 1 commit into
Snowflake-Labs:mainfrom
s1dd54rt5:gcp-auth-enhancements

Conversation

@s1dd54rt5

Copy link
Copy Markdown
  • Start the GCS metadata token refresh thread even when the initial fetch fails, so transient startup failures (DNS, routing, metadata warm-up) do not permanently prevent configuring the bearer-token secret in a valid GCP environment.

  • Block SIGINT/SIGTERM via pthread_sigmask before creating the refresh thread so it inherits the blocked mask, ensuring shutdown signals are delivered to the main thread (matching pgserver's approach).

Description

Please explain what this PR changes and why.


Checklist

  • I have tested my changes and added tests if necessary
  • I updated documentation if needed
  • I confirm that all my commits are signed off (DCO)

DCO Reminder (important)

This project uses the Developer Certificate of Origin (DCO).
DCO is a simple way for you to confirm that you wrote your code and that you have the right to contribute it.

If the DCO check fails, please sign off your commits.

How to sign off

For your last commit:
git commit --amend -s
git push --force

For multiple commits:
git rebase --signoff main
git push --force

More info: https://developercertificate.org/

- Start the GCS metadata token refresh thread even when the initial
  fetch fails, so transient startup failures (DNS, routing, metadata
  warm-up) do not permanently prevent configuring the bearer-token
  secret in a valid GCP environment.

- Block SIGINT/SIGTERM via pthread_sigmask before creating the refresh
  thread so it inherits the blocked mask, ensuring shutdown signals are
  delivered to the main thread (matching pgserver's approach).


static void *
gcs_metadata_secret_refresh_main(void *arg)

@sfc-gh-mslot sfc-gh-mslot Jun 5, 2026

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for looking into this!

Better GCP support is definitely something we need, but I feel like this is not the right place to solve this problem. We use pgduck_server primarily as a dumb Postgres interface to DuckDB, more fine-grained secret configuration usually happens outside of it or in the DuckDB extensions.

Would it be helpful to support https://duckdb.org/community_extensions/extensions/gcs ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants