Skip mission-directory creation in lean mode - #285
Open
CarsonDavis wants to merge 1 commit into
Open
Conversation
In lean mode there is no local Missions/ filesystem — mission assets are served from object storage — so the add handler's unconditional fs.mkdirSync under makedir always threw ENOENT. Because the Config DB row is created and committed before the mkdir runs, the mission ended up existing while the endpoint reported 'Failed to create new mission.', leaving a half-created mission that a retry reported as already existing. Gate the Missions/<name> directory creation on full mode via isLean(); full mode keeps making the directory tree exactly as before. The DB-backed mission row is still created in lean mode, just without the mkdir.
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.
Creating a mission via Configure on the lean (AWS) deployment failed with
ENOENT: mkdir ./Missions/<name>— the mission-create path unconditionally makes aMissions/<name>filesystem directory, but lean has noMissions/tree (assets live in object storage). The DB row committed before the mkdir threw, so the mission was created but the endpoint reported failure and the UI looked broken.!isLean(). Lean skips theMissions/<name>/Layers/Datamkdirs entirely; the DB-backed mission is still created. Full mode is byte-identical — when not lean the condition collapses to the originalmakedircheck.New test covers both modes (lean creates the row and no dirs; full creates the three dirs). Flagged as a follow-up:
/clonehas the same lean-filesystem exposure (an unguardedcreate_mission.pycall).