fix(desktop): disable AOF on Windows to prevent cygwin redis fork crash - #1170
Open
kaverjody wants to merge 1 commit into
Open
fix(desktop): disable AOF on Windows to prevent cygwin redis fork crash#1170kaverjody wants to merge 1 commit into
kaverjody wants to merge 1 commit into
Conversation
The bundled Windows portable redis is a cygwin build whose fork() emulation is unreliable. With --appendonly yes, Redis triggers an AOF background rewrite that forks a child; on cygwin this crashes and can leave an empty appendonly file that overwrites dump.rdb on the next start, wiping all session history. Root-caused during an Ubuntu->Windows desktop migration: after restoring dump.rdb (DBSIZE 3678), the first app launch with AOF enabled crashed the redis child and history disappeared. Switching to --appendonly no loaded dump.rdb correctly (3678 keys intact). Fix: gate AOF by platform. Windows keeps RDB (--save 60 1, ample for desktop single-user); macOS retains AOF (native fork works). [宪宪/布偶猫/glm-latest🐾]
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #1169.
Problem
desktop/service-manager.jsstarts redis with--appendonly yesunconditionally. On Windows the bundled redis is a cygwin build whosefork()emulation is unreliable, so the AOF background rewrite crashes the redis child. Because Redis prefers the appendonly file overdump.rdbwhen AOF is enabled, a crashed/empty appendonly file can overwritedump.rdbon the next start -- total session history loss. See issue #1169 for full root-cause + reproduction.Fix
Gate AOF by platform:
--appendonly no-> relies on RDB (--save 60 1), no fork crash,dump.rdbloads correctly. Ample durability for desktop single-user.--appendonly yesretained -> native redisfork()works, AOF durability preserved.IS_WINalready defined at the top of the file.Verification
--appendonly no, redis loads the restoreddump.rdb(DBSIZE 3678) intact, no crash, history preserved across app restarts.[宪宪/布偶猫/glm-latest🐾]