mirror of
https://github.com/archtechx/tenancy.git
synced 2026-06-21 02:44:03 +00:00
This prevents race conditions that may occur if there are two concurrent processes trying to create the storage path for the tenant. The storagePath() method runs during bootstrap() which can easily happen in two places at once. The race condition specifically occurs in between the is_dir() check and the mkdir() call, the latter producing an exception if the dir already exist. We simply ignore any error coming out of mkdir() and then check for success separately. We could omit that success check since failure is unlikely and would only occur due to a server misconfiguration that would manifest itself in other ways as well, but this way the simple TOC/TOU race condition is prevented while other errors are still reported. We apply the same change to the mkdir() in scopeSessions() as the logic is similar. Resolves #1452 |
||
|---|---|---|
| .. | ||
| Integrations | ||
| BroadcastChannelPrefixBootstrapper.php | ||
| BroadcastingConfigBootstrapper.php | ||
| CacheTagsBootstrapper.php | ||
| CacheTenancyBootstrapper.php | ||
| DatabaseCacheBootstrapper.php | ||
| DatabaseSessionBootstrapper.php | ||
| DatabaseTenancyBootstrapper.php | ||
| FilesystemTenancyBootstrapper.php | ||
| MailConfigBootstrapper.php | ||
| PersistentQueueTenancyBootstrapper.php | ||
| PostgresRLSBootstrapper.php | ||
| QueueTenancyBootstrapper.php | ||
| RedisTenancyBootstrapper.php | ||
| RootUrlBootstrapper.php | ||
| TenantConfigBootstrapper.php | ||
| UrlGeneratorBootstrapper.php | ||