-
Notifications
You must be signed in to change notification settings - Fork 195
Open
Labels
type: feature request‘Nice-to-have’ improvement, new feature or different behavior or design.‘Nice-to-have’ improvement, new feature or different behavior or design.
Description
Per #225, filing an additional ticket for this feature request. Thanks again!
Is your feature request related to a problem? Please describe.
The SysVCacheItemPool class points out that calling code should handle race conditions, but the FetchAuthTokenCache class, which is used by the google-cloud-php
library when the authCache
parameter is passed in (see here), does not do any locking.
This means that users that follow code examples such as the following (from here):
$authCache = new SysVCacheItemPool();
$sessionCache = new SysVCacheItemPool([
// Use a different project identifier for ftok than the default
'proj' => 'B'
]);
$spanner = new SpannerClient([
'authCache' => $authCache
]);
...may run into race condition issues unknowingly.
Describe the solution you'd like
Either of the two:
FetchAuthTokenCache
adds a locking mechanism to safely use the passed inCacheItemPoolInterface
- I file an issue in the google-cloud-php repository to request it use a cache with locking built in.
Metadata
Metadata
Assignees
Labels
type: feature request‘Nice-to-have’ improvement, new feature or different behavior or design.‘Nice-to-have’ improvement, new feature or different behavior or design.