Skip to content

Feature/protocol resp#18

Merged
chaekang merged 8 commits into
chore/devfrom
feature/protocol-resp
Mar 18, 2026
Merged

Feature/protocol resp#18
chaekang merged 8 commits into
chore/devfrom
feature/protocol-resp

Conversation

@chaekang
Copy link
Copy Markdown
Owner

@chaekang chaekang commented Mar 18, 2026

요약

기존 HTTP 계약은 유지한 채, 동일한 dispatcher.dispatch 의미론을 재사용하는 RESP subset TCP 경로를 추가했습니다.

이번 변경은 feature/protocol-resp 범위에 맞춰 RESP 프로토콜 계층과 해당 통합 테스트/스모크 테스트만 포함합니다. main.py는 수정하지 않았고, RESP 서버는 별도 엔트리포인트에서 조립되도록 구성했습니다.

변경 사항

  • RESP 요청 파서 추가
    • RESP array of bulk strings subset만 지원
    • malformed frame은 simple error 반환
  • RESP 응답 codec 추가
    • PING, GET, SET, DEL, EXPIRE, TTL, PERSIST 결과를 RESP 형식으로 직렬화
  • RESP TCP 서버 추가
    • dispatcher.dispatch를 주입받아 기존 명령 의미론 재사용
  • RESP 독립 실행 엔트리포인트 추가
    • Store -> Dispatcher -> RespServer를 별도 조립
    • HTTP 앱과 분리된 방식으로 실행 가능
  • RESP 통합 테스트 확장
    • wire/protocol matrix
    • expiration / lazy expiration
    • invalidation (DEL, EXPIRE <= 0)
    • HTTP/RESP 교차 일관성
    • coarse lock 전제의 동시성 invariant
  • RESP smoke script 추가

유지한 계약

  • HTTP contract unchanged
  • main.py untouched
  • app/core/* untouched
  • RESP는 기존 dispatcher/store semantics를 그대로 사용
  • 문서 계약에 맞춰 RESP는 bulk string array subset만 지원

검증

자동 테스트

  • .\.venv\Scripts\python.exe -m pytest tests\integration\test_protocol_resp.py
    • 234 passed
  • .\.venv\Scripts\python.exe -m pytest tests\integration\test_protocol_resp.py tests\integration\test_protocol_http.py tests\integration\test_http_stack_integration.py
    • 251 passed
  • .\.venv\Scripts\python.exe -m ruff check tests\integration\test_protocol_resp.py
  • .\.venv\Scripts\python.exe -m ruff format --check tests\integration\test_protocol_resp.py

수동 smoke

  • RESP 서버 실행 후 tests/smoke/resp_smoke.py로 확인
  • 확인 항목:
    • PING
    • SET / GET
    • EXPIRE / TTL
    • PERSIST
    • DEL
    • expired miss / invalidation
    • malformed RESP frame error

현재 제한 사항

  • RESP는 array of bulk strings만 지원합니다.
  • inline command, nested array, null bulk string 요청은 지원하지 않습니다.
  • 지원 명령은 MVP 범위의 PING, GET, SET, DEL, EXPIRE, TTL, PERSIST로 제한됩니다.
  • malformed RESP frame은 simple error를 반환한 뒤 연결을 종료합니다.
  • 동시성은 coarse lock 기반 안전성/invariant를 검증하며, same-key 경쟁의 결정적 winner ordering까지 보장하지는 않습니다.

@chaekang chaekang merged commit 7cc9fa8 into chore/dev Mar 18, 2026
1 of 2 checks passed
@chaekang chaekang self-assigned this Mar 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants