Метод claimExistingRunsWarning
Сигнатура метода
public function claimExistingRunsWarning(): bool
Возвращает:
bool
Описание
Atomically spends the current user's single right to see the existing-runs warning: returns true only to the call that actually took it, false to every later one. That asymmetry is what makes "shown exactly once" a checked property rather than an agreement between two requests. The lock name is built from the current user, so users never queue behind each other, and a call that cannot take the lock does not wait and does not show the warning (fail-open). The check under the lock reads past the CUserOptions caches on purpose: the cheap isExistingRunsWarningSpent() above it has already cached the whole option category for this request, so a cached read here would answer from a snapshot taken before the competing request wrote its value. A check-and-write under a lock has to read from the same source of truth the write goes to - hence the master-only read. The write stays under the lock but outside that mode: a write is never routed to a replica anyway, while outside the mode the pool sees it and keeps later reads of b_user_option on the master. setOption() drops both cache levels of the category, so the cheap reads that follow it in this request are correct.
Расположение
Исходный файл метода в Bitrix Framework
~/bitrix/modulesbizproc/lib/Internal/Config/Storage.php