Skip to content

Commit 561a727

Browse files
committed
Backport fix: Fixed race condition when many attachments creates event session at the same moment
1 parent 82f2e7e commit 561a727

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

src/jrd/event.cpp

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -707,6 +707,13 @@ void EventManager::create_process()
707707
**************************************/
708708
acquire_shmem();
709709

710+
if (m_processOffset)
711+
{
712+
fb_assert(m_process);
713+
release_shmem();
714+
return;
715+
}
716+
710717
prb* const process = (prb*) alloc_global(type_prb, sizeof(prb), false);
711718
process->prb_process_id = PID;
712719
insert_tail(&m_header->evh_processes, &process->prb_processes);
@@ -1476,6 +1483,16 @@ void EventManager::watcher_thread()
14761483
{
14771484
iscLogException("Error in event watcher thread\n", ex);
14781485
}
1486+
1487+
try
1488+
{
1489+
if (startup)
1490+
m_startupSemaphore.release();
1491+
}
1492+
catch (const Firebird::Exception& ex)
1493+
{
1494+
iscLogException("Error in event watcher thread\n", ex);
1495+
}
14791496
}
14801497

14811498
} // namespace

0 commit comments

Comments
 (0)