Skip to content

Allow custom locking in GeneralHTTPCredentialsProvider (1.11.927) - #47

Merged
kolsha merged 1 commit into
ClickHouse/1.11.927from
custom-locking-general-http-credentials-provider-1.11.927
Nov 23, 2026
Merged

kolsha merged 1 commit into
ClickHouse/1.11.927from
custom-locking-general-http-credentials-provider-1.11.927

Conversation

@kolsha

@kolsha kolsha commented Nov 23, 2026

Copy link
Copy Markdown

Same change as #46, for ClickHouse/1.11.927: ClickHouse master moved to this branch on 2026-11-17, after #46 had been opened against ClickHouse/1.11.907, so the current submodule pin still has these members private.

ExpiresSoon, m_loadFrequencyMs and m_credentials of GeneralHTTPCredentialsProvider become protected, so that a derived provider can replace the SDK locking while it reuses the SDK refresh and cache.

The provider holds its ReaderWriterLock across the credential request. A caller that runs the request in a cooperative scheduler, where the request suspends, needs its own lock around the refresh. To do that without copying the refresh logic, the derived provider has to decide when to refresh (ExpiresSoon, m_loadFrequencyMs) and return the cached result (m_credentials), as the SDK GetAWSCredentials does. Reload is already protected.

Only access specifiers change; the order of data members, and therefore the layout, is unchanged. The commit is a clean cherry-pick of 03951d9 onto 4b55ca8; ClickHouse was not built against this branch yet.

Related: #46

Make `ExpiresSoon`, `m_loadFrequencyMs` and `m_credentials` protected so that derived providers can replace the synchronization while reusing the SDK refresh implementation and cache. The order of data members is unchanged.

Validation: ClickHouse builds against it, and the gtests of its derived provider pass.
(cherry picked from commit 03951d9)
@kolsha
kolsha merged commit 4af0e43 into ClickHouse/1.11.927 Nov 23, 2026
1 of 2 checks passed
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.

1 participant