Skip to content

fix(framework-context): preserve request errors when provider cleanup fails - #3438

Merged
kang-heewon merged 3 commits into
trunkfrom
fix/3006-request-cleanup-problem
Oct 9, 2026
Merged

kang-heewon merged 3 commits into
trunkfrom
fix/3006-request-cleanup-problem

Conversation

@kang-heewon

@kang-heewon kang-heewon commented Oct 9, 2026 •

Copy link
Copy Markdown
Member

요청 provider 정리 중 잡은 Error를 JSON-safe 메시지로 변환하고 첫 Error는 cause로 보존합니다. 성공한 요청의 정리 실패는 framework-context/request-scope-disposal-failed(500)로 나타나며, 이미 실패한 요청은 원래 오류 객체를 유지하고 기존 Inspector → logger → console 경로로 정리 실패를 한 번 보고합니다.

동기·비동기 callback, 여러 provider의 역순 정리, 비-Error throw를 검증합니다. 객체·함수 throw는 사용자 coercion을 실행하지 않으므로 메시지 변환 실패가 요청 오류를 가리지 않습니다. cause가 없을 때는 옵션에서 제외하여 strict optional-property 계약을 지킵니다. Problem extensions 검증과 요청 오류 hook·transport 응답 정책은 유지합니다. framework-context patch changeset을 포함합니다.

Closes #3006

Validation

Elevated profile: 요청 오류 전파 계약을 HTTP·tRPC·GraphQL·testing·search 소비 경로가 사용합니다.

  • 수정 전 회귀 테스트 10개 실패; 객체 coercion 보완 전 추가 회귀 테스트 6개 실패.
  • 최종 패키지 테스트 309개 통과. package typecheck·lint 통과.
  • strict contract typecheck 통과: 새 진단 0개, 기존 baseline 409개와 일치. 최종 변경 파일 format 통과.
  • Problem registry 재생성: 950개 진단, 생성 파일 변경 없음. companion architecture policy·public API 검증 통과. 최종 static companion 결과는 실행 증거와 별도로 기록했습니다.
  • 정상 pre-push hook 통과: 전체 test 299/299 작업, 전체 typecheck 316/316 작업 및 tracked-file mutation guard. hook 우회 없음.
  • 최종 head 독립 코드 리뷰·검증 리뷰 모두 PASS.
  • 전체 빌드 증거: 최종 실행 291개 작업 통과 + docs 1개 동일 입력 재사용. 이전 head 전체 빌드는 292/292 통과했습니다. 캐시 산출물 133개 API 모델과 docs 입력의 byte 동등성을 독립 검증했습니다. 중복 docs 렌더링은 의도적으로 종료했으며 해당 실행 전체의 종료 코드를 통과로 기록하지 않았습니다.

Local verification conditions

로컬 pnpm check의 Container 벤치마크가 실패했습니다. 별도 실행에서도 등록 p75 42.4ms가 10ms 임계값을 초과했습니다. 변경 전 production Context로 실행한 동일 benchmark도 등록 60.5ms·검증 30.8ms로 실패했습니다. Container 등록·검증 구현, benchmark와 임계값은 이 PR에서 변경하지 않았습니다. 이 결과는 #3006 없이도 실패가 재현된다는 근거이며, host 경합이나 성능 원인을 확정하는 근거는 아닙니다. 별도 추적: #3435. 임계값을 완화하거나 검증을 우회하지 않았습니다.

Head: 5ca9aee756cc0d6cf886f0adef6fe34248e4b025.
최초 검증 base: 02b2e262ea083076b613839cf2749ee3c44c1495.

Integration

현재 base는 최초 검증 base와 같습니다. GitHub merge candidate e92422571aac120a9dcb9949d421266f631746be의 부모는 기록된 base·head이고, tree는 head와 동일한 26d977eb8e171ed94b64fb000057f29eadb23682입니다. 해당 범위의 로컬 검증·리뷰 결과를 재사용합니다. 필수 CI run 37887680423과 별도 benchmark run 37887680462는 아직 진행 중이며, 통과로 기록하지 않았습니다.

CI benchmark run 37887680462 attempt 1에서 최종 head를 검증한 실제 benchmark-result.json은 allPassed: true, gateFailures: []이며 모든 임계값이 통과했습니다. advisory workflow의 초록 상태에만 의존하지 않고 산출물로 확인했습니다. 로컬 benchmark 실패의 재현 기록은 #3435에 유지합니다. 나머지 필수 CI는 진행 중입니다.

최종 독립 검증에서 로컬 통과 항목, strict·format 보완, 최종 head의 CI benchmark artifact를 대조한 증거 통합을 PASS로 판정했습니다. 최초 pnpm check 실행의 실패 기록은 유지하며 전체 wrapper가 통과했다고 주장하지 않습니다. 아직 진행 중인 필수 CI가 완료되어야 병합할 수 있습니다.

Copilot AI balanced review requested due to automatic review settings October 9, 2026 05:15

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@coderabbitai

coderabbitai Bot commented Oct 9, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 58 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: 129531b2-bfd0-4d99-88f4-34c0eb706639
📥 Commits

Reviewing files that changed from the base of the PR and between 02b2e26 and 5ca9aee.

📒 Files selected for processing (3)
  • .changeset/tidy-request-cleanup.md
  • packages/framework-context/src/libs/Context.ts
  • packages/framework-context/src/tests/RequestScoped.spec.ts
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions

github-actions Bot commented Oct 9, 2026

Copy link
Copy Markdown

📊 Benchmark Results

✅ All benchmarks passed

Benchmark p75 Threshold Baseline vs Baseline Status Notes
CrocoApp constructor 12.7μs 30.0ms 8.2μs +55.6% ❌ -
CrocoApp lambdaHandler (10 controllers) 1.3ms 50.0ms 258.4μs +418.3% ❌ -
Lambda cold-start simulation 1.5ms 80.0ms 418.1μs +260.5% ❌ -
Lambda cold-start with headers 1.4ms 80.0ms 369.7μs +287.5% ❌ -
Lambda cold-start with binary body 1.3ms 80.0ms 339.1μs +287.3% ❌ -
Lambda cold-start with query params 1.3ms 80.0ms 301.3μs +329.7% ❌ -
Lambda cold-start with authorizer context 1.3ms 80.0ms 299.8μs +334.3% ❌ -
Lambda cold-start realistic scenario 1.3ms 80.0ms 299.2μs +335.0% ❌ -
EventBusConfig.start (10 handlers) 5.6μs 10.0ms 1.4μs +287.9% ❌ -
EventPublisher.publishNow single event 2.5μs 2.0ms 1.7μs +50.0% ❌ -
DefaultHandlerResolver.resolve × 10 0.2μs 5.0ms 0.1μs +138.8% ❌ -
Container.get singleton (cold) 102.8μs 5.0ms 70.3μs +46.3% ❌ -
Container.register × 50 components 2.7ms 10.0ms 3.2ms -15.6% ✅ -
Container.validate (50 components) 3.1ms 20.0ms 3.4ms -7.4% ✅ -
Container.get singleton (warm) 1.0μs 500.0μs 1.6μs -41.1% ✅ -
TelemetryRuntime.init (lambda preset) 12.7μs 200.0ms 1.1ms -98.8% ✅ -
lambdaPreset config creation 1.4μs 2.0ms 1.4μs -3.5% ✅ -

Updated: 2026-10-09T05:17:53.165Z · Commit: 5ca9aee

@kang-heewon
kang-heewon merged commit f9193be into trunk Oct 9, 2026
21 checks passed
@kang-heewon
kang-heewon deleted the fix/3006-request-cleanup-problem branch October 9, 2026 06:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants