diff --git a/bin/release/redis-2.8.9.zip b/bin/release/redis-2.8.9.zip index 0a9c428758a8b067adff285102b74597efdb3557..d329abbf59eca7b112f702eafbc994370b5ed6f7 100644 Binary files a/bin/release/redis-2.8.9.zip and b/bin/release/redis-2.8.9.zip differ diff --git a/src/Win32_Interop/Win32_QFork.cpp b/src/Win32_Interop/Win32_QFork.cpp index 8b4cfcec6d8e750f50e2b90f8e98cb78247ed3bb..d9efa16e3879f7804f5e572d7175297bcd004447 100644 --- a/src/Win32_Interop/Win32_QFork.cpp +++ b/src/Win32_Interop/Win32_QFork.cpp @@ -324,6 +324,26 @@ BOOL QForkMasterInit( __int64 maxheapBytes ) { "Invalid number of heap blocks."); } + // FILE_FLAG_DELETE_ON_CLOSE will not clean up files in the case of a BSOD or power failure. + // Clean up anything we can to prevent excessive disk usage. + wchar_t heapMemoryMapWildCard[MAX_PATH]; + WIN32_FIND_DATA fd; + swprintf_s( + heapMemoryMapWildCard, + MAX_PATH, + L"%s_*.dat", + cMapFileBaseName); + HANDLE hFind = FindFirstFile(heapMemoryMapWildCard, &fd); + while (hFind != INVALID_HANDLE_VALUE) { + // Failure likely means the file is in use by another redis instance. + DeleteFile(fd.cFileName); + + if (FALSE == FindNextFile(hFind, &fd)) { + CloseHandle(hFind); + hFind = INVALID_HANDLE_VALUE; + } + } + wchar_t heapMemoryMapPath[MAX_PATH]; swprintf_s( heapMemoryMapPath,