mirror of
https://github.com/FirebirdSQL/firebird.git
synced 2025-01-24 04:03:03 +01:00
Additional fix for bug CORE-6253 : Crash caused by the locked fb_lock file
Retry attempts to initialize shared memory when truncation of shmem file was failed with ERROR_USER_MAPPED_FILE. The case is when last process that holds shared memory and its initialization event was killed (or crashed) and didn't released OS objects in correct order (event, file, memory mappings). I.e. new process successfully creates event, correctly consider itself as initializator, but failed to truncate file as it is still in use by old instance of memory mappings in killed\crashed process. This prevents bugcheck in LM and abort() as consequence.
This commit is contained in:
parent
f470a21801
commit
a1116feb60
@ -2248,7 +2248,12 @@ SharedMemoryBase::SharedMemoryBase(const TEXT* filename, ULONG length, IpcObject
|
||||
CloseHandle(file_handle);
|
||||
|
||||
if (err == ERROR_USER_MAPPED_FILE)
|
||||
{
|
||||
if (retry_count < 50) // 0.5 sec
|
||||
goto retry;
|
||||
|
||||
Arg::Gds(isc_instance_conflict).raise();
|
||||
}
|
||||
else
|
||||
system_call_failed::raise("SetFilePointer", err);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user