mirror of
https://github.com/FirebirdSQL/firebird.git
synced 2025-01-24 03:23:03 +01:00
Fixed bug CORE-5350 : Assert in CachedMasterInterface::set
This commit is contained in:
parent
6a32ca767e
commit
be8a09d510
@ -585,36 +585,43 @@ public:
|
|||||||
{ }
|
{ }
|
||||||
|
|
||||||
~MappingIpc()
|
~MappingIpc()
|
||||||
|
{
|
||||||
|
shutdown();
|
||||||
|
}
|
||||||
|
|
||||||
|
void shutdown()
|
||||||
{
|
{
|
||||||
if (!sharedMemory)
|
if (!sharedMemory)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
Guard gShared(this);
|
|
||||||
|
|
||||||
MappingHeader* sMem = sharedMemory->getHeader();
|
|
||||||
|
|
||||||
startupSemaphore.tryEnter(5);
|
|
||||||
sMem->process[process].flags &= ~MappingHeader::FLAG_ACTIVE;
|
|
||||||
(void) // Ignore errors in cleanup
|
|
||||||
sharedMemory->eventPost(&sMem->process[process].notifyEvent);
|
|
||||||
cleanupSemaphore.tryEnter(5);
|
|
||||||
|
|
||||||
// Ignore errors in cleanup
|
|
||||||
sharedMemory->eventFini(&sMem->process[process].notifyEvent);
|
|
||||||
sharedMemory->eventFini(&sMem->process[process].callbackEvent);
|
|
||||||
|
|
||||||
bool found = false;
|
|
||||||
for (unsigned n = 0; n < sMem->processes; ++n)
|
|
||||||
{
|
{
|
||||||
if (sMem->process[n].flags & MappingHeader::FLAG_ACTIVE)
|
Guard gShared(this);
|
||||||
{
|
MappingHeader* sMem = sharedMemory->getHeader();
|
||||||
found = true;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!found)
|
startupSemaphore.tryEnter(5);
|
||||||
sharedMemory->removeMapFile();
|
sMem->process[process].flags &= ~MappingHeader::FLAG_ACTIVE;
|
||||||
|
(void) // Ignore errors in cleanup
|
||||||
|
sharedMemory->eventPost(&sMem->process[process].notifyEvent);
|
||||||
|
cleanupSemaphore.tryEnter(5);
|
||||||
|
|
||||||
|
// Ignore errors in cleanup
|
||||||
|
sharedMemory->eventFini(&sMem->process[process].notifyEvent);
|
||||||
|
sharedMemory->eventFini(&sMem->process[process].callbackEvent);
|
||||||
|
|
||||||
|
bool found = false;
|
||||||
|
for (unsigned n = 0; n < sMem->processes; ++n)
|
||||||
|
{
|
||||||
|
if (sMem->process[n].flags & MappingHeader::FLAG_ACTIVE)
|
||||||
|
{
|
||||||
|
found = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!found)
|
||||||
|
sharedMemory->removeMapFile();
|
||||||
|
}
|
||||||
|
sharedMemory = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
void clearMap(const char* dbName)
|
void clearMap(const char* dbName)
|
||||||
@ -1338,4 +1345,9 @@ RecordBuffer* MappingList::getList(thread_db* tdbb, jrd_rel* relation)
|
|||||||
return getData(relation);
|
return getData(relation);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void shutdownMappingIpc()
|
||||||
|
{
|
||||||
|
mappingIpc->shutdown();
|
||||||
|
}
|
||||||
|
|
||||||
} // namespace Jrd
|
} // namespace Jrd
|
||||||
|
@ -42,6 +42,7 @@ bool mapUser(Firebird::string& name, Firebird::string& trusted_role, Firebird::s
|
|||||||
const char* alias, const char* db, const char* securityDb, Firebird::ICryptKeyCallback* cryptCb,
|
const char* alias, const char* db, const char* securityDb, Firebird::ICryptKeyCallback* cryptCb,
|
||||||
Firebird::IAttachment* att);
|
Firebird::IAttachment* att);
|
||||||
void clearMap(const char* dbName);
|
void clearMap(const char* dbName);
|
||||||
|
void shutdownMappingIpc();
|
||||||
|
|
||||||
class GlobalMappingScan: public VirtualTableScan
|
class GlobalMappingScan: public VirtualTableScan
|
||||||
{
|
{
|
||||||
|
@ -4134,6 +4134,7 @@ void JProvider::shutdown(CheckStatusWrapper* status, unsigned int timeout, const
|
|||||||
// Do not put it into separate shutdown thread - during shutdown of TraceManager
|
// Do not put it into separate shutdown thread - during shutdown of TraceManager
|
||||||
// PluginManager wants to lock a mutex, which is sometimes already locked in current thread
|
// PluginManager wants to lock a mutex, which is sometimes already locked in current thread
|
||||||
TraceManager::shutdown();
|
TraceManager::shutdown();
|
||||||
|
shutdownMappingIpc();
|
||||||
}
|
}
|
||||||
catch (const Exception& ex)
|
catch (const Exception& ex)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user