mirror of
https://gh.wpcy.net/https://github.com/discourse/discourse.git
synced 2026-06-18 18:18:48 +08:00
Reattempt of #40294, which was reverted in #40301 because two concurrent processes raced on plugin symlink creation in `Discourse::Utils.atomic_ln_s`. The first commit here fixes that race at the source by serializing the check-and-replace with a file lock and switching to `File.rename` (atomic on POSIX, doesn't follow symlinks at the destination). A stress test of the previous implementation failed 15/16 workers under contention; the new implementation passes 5/5 stress runs and 5/5 end-to-end CI-like runs locally with `LOAD_PLUGINS=1`. The second commit is the parallelization itself: the two CI database-setup steps run concurrently through GNU `parallel` instead of one after the other. It also adds `Discourse.test_env_number` to align the `TEST_ENV_NUMBER=""` interpretation across `FileStore::BaseStore`, `Stylesheet::Manager`, `S3Helper`, and `BackupRestore::S3BackupStore` with `config/boot.rb` — without this, the gem's first worker and the primary process would race on `public/uploads/default/test_0/`. |
||
|---|---|---|
| .. | ||
| backup_file_handler.rb | ||
| backup_store.rb | ||
| backuper.rb | ||
| creator.rb | ||
| database_restorer.rb | ||
| factory.rb | ||
| local_backup_store.rb | ||
| logger.rb | ||
| meta_data_handler.rb | ||
| restorer.rb | ||
| s3_backup_store.rb | ||
| system_interface.rb | ||
| uploads_restorer.rb | ||