8
0
mirror of https://github.com/FirebirdSQL/firebird.git synced 2025-01-23 02:03:04 +01:00

Fixed bug #8149 : The hung or crash could happen when connection fires TRACE_EVENT_DETACH event and new trace session created concurrently

This commit is contained in:
Vlad Khorsun 2024-06-09 13:49:02 +03:00
parent 21bb43a447
commit ed7d59e05d

View File

@ -181,6 +181,10 @@ void TraceManager::update_sessions()
{ // scope
ConfigStorage* storage = getStorage();
// don't attach going attachment to the new trace sessions, it allows
// to avoid problems later - when mapping uses this going attachment
const bool noNewSessions = attachment && (attachment->att_purge_tid);
StorageGuard guard(storage);
storage->restart();
@ -192,7 +196,7 @@ void TraceManager::update_sessions()
FB_SIZE_T pos;
if (trace_sessions.find(session.ses_id, pos))
liveSessions.add(session.ses_id);
else
else if (!noNewSessions)
newSessions.add(FB_NEW_POOL(pool) TraceSession(pool, session));
}
}