fix(#4561): catch RecursionError on deeply-nested manifest (BRICK)
Codex+Opus ship-gate: a <=64KB but deeply-nested JSON manifest makes json.loads raise RecursionError, which escaped _read_manifest_urls into the app-shell route -> every page load 503s. Add RecursionError to the fail-safe except + regression test (verified red-without/green-with). Co-authored-by: santastabber <santastabber@users.noreply.github.com>
This commit is contained in:
1 parent
3e229141af
commit
a10f511a13
2 files changed
+29
No files matched your search
@@ -253,6 +253,12 @@ def _read_manifest_urls(root: Path) -> Tuple[List[str], List[str]]:
|
||||
except json.JSONDecodeError:
|
||||
_log.warning("Configured extension manifest is not valid JSON")
|
||||
return [], []
|
||||
except RecursionError:
|
||||
# A <=64KB but deeply-nested manifest makes json.loads exceed the
|
||||
# interpreter recursion limit. Without this, the RecursionError escapes
|
||||
# into the app-shell route and every page load 503s. Fail safe.
|
||||
_log.warning("Configured extension manifest is too deeply nested")
|
||||
return [], []
|
||||
except (OSError, UnicodeDecodeError):
|
||||
_log.warning("Configured extension manifest could not be read")
|
||||
return [], []
|
||||
|
||||
Reference in new issue
Block a user