배경
PR #56 (M8 admin control-plane UI) 리뷰에서 gemini-code-assist가 지적한 thread-safety 항목의 추적 이슈.
runtime/dashboard.py의 ThreadingWSGIServer(ThreadingMixIn)는 요청을 스레드별로 처리하지만, make_dashboard_app(store, …)가 단일 store 인스턴스를 모든 요청 스레드와 공유한다. dynamodb 어댑터(storage/adapters/nosql_db/store.py:155-157)는 단일 boto3 resource/Table(self._resource/self._table)을 들고 있고 boto3 resource/Session은 thread-safe하지 않다. 동시 요청 시 race/예외/직렬화 캐시 오염 가능.
왜 지금 PR에서 안 고치고 분리하나
영향 파일
src/security_scanner/runtime/dashboard.py (make_dashboard_app, run_dashboard)
src/security_scanner/runtime/read_api.py:426-431 (공유 store로 라우트 dispatch)
src/security_scanner/storage/adapters/nosql_db/store.py:155-157 (공유 boto3 resource/Table)
Acceptance Criteria
- 동시 요청이 boto3 resource/Table을 공유하지 않음:
threading.local 기반 per-thread store(스레드별 boto3 resource/Table 지연 생성) 또는 thread-safe 저수준 client 경로.
make_dashboard_app를 store-factory 주입형으로 조정(테스트는 factory 또는 per-thread fake로 갱신).
- 정적 자산 경로(serve_static)는 store 미사용이므로 무영향 유지.
- 회귀: 기존 dashboard 테스트 + node --test 그린.
출처: PR #56 review (gemini-code-assist, dashboard.py:180). 우선순위: trust model상 낮음(triage 필요).
배경
PR #56 (M8 admin control-plane UI) 리뷰에서 gemini-code-assist가 지적한 thread-safety 항목의 추적 이슈.
runtime/dashboard.py의ThreadingWSGIServer(ThreadingMixIn)는 요청을 스레드별로 처리하지만,make_dashboard_app(store, …)가 단일store인스턴스를 모든 요청 스레드와 공유한다. dynamodb 어댑터(storage/adapters/nosql_db/store.py:155-157)는 단일 boto3 resource/Table(self._resource/self._table)을 들고 있고 boto3 resource/Session은 thread-safe하지 않다. 동시 요청 시 race/예외/직렬화 캐시 오염 가능.왜 지금 PR에서 안 고치고 분리하나
/snapshot+/findings정도.make_dashboard_app/run_dashboard/cli/commands/dashboard.py시그니처 + 테스트 변경을 동반 → PR feat(dashboard): M8 admin control-plane UI — read-only live dashboard (scale #2 GATE3) #56 범위 확대. 응집을 위해 분리.영향 파일
src/security_scanner/runtime/dashboard.py(make_dashboard_app, run_dashboard)src/security_scanner/runtime/read_api.py:426-431(공유 store로 라우트 dispatch)src/security_scanner/storage/adapters/nosql_db/store.py:155-157(공유 boto3 resource/Table)Acceptance Criteria
threading.local기반 per-thread store(스레드별 boto3 resource/Table 지연 생성) 또는 thread-safe 저수준 client 경로.make_dashboard_app를 store-factory 주입형으로 조정(테스트는 factory 또는 per-thread fake로 갱신).출처: PR #56 review (gemini-code-assist,
dashboard.py:180). 우선순위: trust model상 낮음(triage 필요).