mirror of
https://github.com/appwrite/appwrite.git
synced 2026-11-18 20:36:03 +00:00
Keep stats workers serial: shared accumulator state is not coroutine-safe
StatsUsage batches metrics across messages on shared instance state ($stats/$keys/$projects/$statDocuments); concurrent consume coroutines race the flush in commitToDB, losing aggregates on reset and double-applying upsertDocumentsWithIncrease on overlapping flushes. StatsResources resets its shared $documents buffer at the start of each job, so a second coroutine starting mid-count wipes the first one's batch and the projects' metrics interleave into one write. Both stay at 1 coroutine until accumulation moves to per-message state. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
1 parent
e3afc66bac
commit
ead860457c
1 file changed
+2
-2
+2
-2
@@ -1068,7 +1068,7 @@ services:
|
||||
environment:
|
||||
- _APP_ENV
|
||||
- _APP_WORKERS_NUM=1
|
||||
- _APP_WORKER_MAX_COROUTINES=8
|
||||
- _APP_WORKER_MAX_COROUTINES=1
|
||||
- _APP_WORKER_PER_CORE
|
||||
- _APP_POOL_ADAPTER
|
||||
- _APP_OPENSSL_KEY_V1
|
||||
@@ -1104,7 +1104,7 @@ services:
|
||||
environment:
|
||||
- _APP_ENV
|
||||
- _APP_WORKERS_NUM=1
|
||||
- _APP_WORKER_MAX_COROUTINES=8
|
||||
- _APP_WORKER_MAX_COROUTINES=1
|
||||
- _APP_WORKER_PER_CORE
|
||||
- _APP_POOL_ADAPTER
|
||||
- _APP_OPENSSL_KEY_V1
|
||||
|
||||
Reference in new issue
Block a user