fix(core): 코어 업데이트 spawn 자식의 config 캐시 오판 3건 수정 + 컨테이너 보존 래퍼 전수
7.0.9 클린 설치본에서 7.0.10 으로 올리자 업그레이드 스텝 단계가 "부모 메모리 stale" 로 중단됐다. 스텝 자식은 부모가 비우지 않은 이전 버전 config 캐시로 부팅해 env APP_VERSION 오버라이드와 신버전 config/app.php 의 update 목록을 모두 보지 못한다. 이전 릴리즈에서는 자식 진입부의 config:cache 가 전역 Container 를 일회용 앱으로 바꿔 놓는 부수효과로 가드가 우연히 침묵했고, 그 부수효과를 걷어낸 withPreservedContainer 가 잠복 결함을 드러냈다. - stale 가드는 CoreVersionChecker::getCoreVersion(env 우선) 으로 판독 - 부모는 spawn 직전 config 캐시를 비우고, 자식은 캐시 파일이 있으면 디스크 config 를 직접 읽는다 (7.0.10 이 추가한 public/build/ext 쓰기 권한 정상화 누락 차단) - route:cache 도 같은 부수효과를 남기므로 RouteCacheHelper·optimizeSystem 을 보존 래퍼로 감쌌다 (단독 스텝 재실행·시스템 최적화 뒤 정적 재게시 예약 소실) - 과거 업그레이드 사고 14부류를 7.0.10 변경과 대조 — 재발 조건은 위 3건뿐 - audit 룰 fresh-app-artisan-call-outside-cache-helper + 픽스처, 회귀 테스트 6건(수정 전 red)
This commit is contained in:
1 parent
b79e082ca3
commit
67cae00dd8
15 files changed
+477
-10
No files matched your search
@@ -111,7 +111,17 @@ class ExecuteUpgradeStepsCommand extends Command
|
||||
// 해당 release 의 upgrade step 단발 처리. (예: beta.3→beta.4 의 lang-packs/* 보정)
|
||||
if (! $stepsOnly) {
|
||||
try {
|
||||
$writablePaths = (array) config('app.update.restore_ownership_group_writable', []);
|
||||
// 구버전 부모(7.0.9 이하)는 spawn 전에 config 캐시를 비우지 않아 이 자식이 이전 버전
|
||||
// 캐시로 부팅할 수 있다. 그러면 `config()` 는 옛 목록이라 신버전이 추가한 디렉토리가
|
||||
// 빠진다 — 캐시 부팅이면 디스크 config/app.php 를 직접 읽는다 (7.0.9→7.0.10 실사례).
|
||||
// 판정은 캐시 파일의 실존으로 한다 — 부팅에 쓰였든 위 updateComposerAutoload() 가 방금
|
||||
// 재생성했든, 파일이 있으면 메모리 config 를 신뢰하지 않는다 (디스크 판독은 멱등).
|
||||
if (is_file($this->laravel->getCachedConfigPath())) {
|
||||
Log::channel('upgrade')->warning('[spawn] 이전 버전 config 캐시로 부팅됨 — update 목록은 디스크 config/app.php 에서 읽는다');
|
||||
$writablePaths = (array) $service->freshDiskUpdateConfig('restore_ownership_group_writable', []);
|
||||
} else {
|
||||
$writablePaths = (array) config('app.update.restore_ownership_group_writable', []);
|
||||
}
|
||||
if (! empty($writablePaths)) {
|
||||
$service->ensureWritableDirectories(
|
||||
$writablePaths,
|
||||
|
||||
Reference in new issue
Block a user