<b>4.0.8.3331</b>
Alexey Kovyazin 2026.11.08 11:27:29
Mapping: do not hold the spCache lock while attaching to the main database
Mapping::mapUser() took the system privileges cache Sync in SYNC_EXCLUSIVE
and attached to the main database under it. With populateMutex out of the
way, the IBSurgeon/hqbird#12 cycle closes here instead: the rejected nested
attach closes the database and waits for the garbage collector, and the
collector's last TRA_commit waits for this Sync in SYNC_SHARED (hang in the
first iteration of the repro script on Linux).
Attach with no lock; take SYNC_EXCLUSIVE only to check the cache again and
populate it.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
(cherry picked from commit 6dcb8e6d8e5d40c833cb635b82752c161d7f5119)

Changed paths:
  M src/jrd/Mapping.cpp