////

비동기·분산 경계에서는 원본 데이터와 불변 상태를 먼저 확정하라

비동기·분산 경계에서는 원본 데이터와 불변 상태를 먼저 확정하라

////

Summary#

비동기·분산 경계에서는 원본 데이터와 불변 상태를 먼저 확정하라

Problem#

장치 전송 중 패딩하거나, 외부 도구가 바꿀 수 있는 메타데이터를 캐시된 공유 상태에 오래 의존하면 드물게만 재현되는 race condition, stale cache crash, 분산 환경 전용 오동작이 생긴다.

Solution#

비동기 경계에 들어가기 전에 데이터 정규화와 패딩을 끝내고, 변경 가능한 외부 메타데이터는 호출 시점의 source of truth에서 다시 유도하라. 공유 캐시를 const 경로에서 몰래 mutate하지 말고, 타입도 dataclass 같은 상태 객체보다 TypedDict/명시적 구조처럼 더 단순한 계약으로 고정하라.

Failure Modes#

  • 단일 노드에서는 통과하지만 DP/멀티프로세스에서만 깨짐
  • const 메서드에서 캐시를 갱신해 데이터 레이스를 새로 만듦
  • 전체 시퀀스 디코드 결과만 보고 중간 토큰/바이트 조각 경계 버그를 놓침

Sources#

  • https://github.com/tensorflow/tensorflow/pull/121146
  • https://github.com/tensorflow/tensorflow/pull/121147
  • https://github.com/tensorflow/tensorflow/pull/121055
  • https://github.com/tensorflow/tensorflow/pull/121012
  • https://github.com/tensorflow/tensorflow/pull/120930
  • https://github.com/tensorflow/tensorflow/pull/121006
  • https://github.com/tensorflow/tensorflow/pull/121060
  • https://github.com/tensorflow/tensorflow/pull/121039
  • https://github.com/tensorflow/tensorflow/pull/121031
  • https://github.com/tensorflow/tensorflow/pull/121036
  • https://github.com/tensorflow/tensorflow/pull/121129
  • https://github.com/tensorflow/tensorflow/pull/121133
  • https://github.com/tensorflow/tensorflow/pull/120984
  • https://github.com/tensorflow/tensorflow/pull/120829
  • https://github.com/huggingface/transformers/pull/46593
  • https://github.com/huggingface/transformers/pull/46609
  • https://github.com/huggingface/transformers/pull/46596
  • https://github.com/huggingface/transformers/pull/46605
  • https://github.com/huggingface/transformers/pull/46608
  • https://github.com/huggingface/transformers/pull/46600
  • https://github.com/huggingface/transformers/pull/46602
  • https://github.com/huggingface/transformers/pull/46601
  • https://github.com/huggingface/transformers/pull/46530
  • https://github.com/microsoft/ML-For-Beginners/pull/978
  • https://github.com/microsoft/ML-For-Beginners/pull/971
  • https://github.com/microsoft/ML-For-Beginners/pull/967
  • https://github.com/microsoft/ML-For-Beginners/pull/970
  • https://github.com/ClickHouse/ClickHouse/pull/94859
  • https://github.com/ClickHouse/ClickHouse/pull/100407
  • https://github.com/ClickHouse/ClickHouse/pull/107133
  • https://github.com/ClickHouse/ClickHouse/pull/106188
  • https://github.com/ClickHouse/ClickHouse/pull/107152
  • https://github.com/ClickHouse/ClickHouse/pull/107250
  • https://github.com/ClickHouse/ClickHouse/pull/107397
  • https://github.com/ClickHouse/ClickHouse/pull/107208
  • https://github.com/ClickHouse/ClickHouse/pull/107246
  • https://github.com/ClickHouse/ClickHouse/pull/107375
  • https://github.com/ClickHouse/ClickHouse/pull/107347
  • https://github.com/ClickHouse/ClickHouse/pull/107253
  • https://github.com/ClickHouse/ClickHouse/pull/106414
  • https://github.com/ClickHouse/ClickHouse/pull/96802
  • https://github.com/ClickHouse/ClickHouse/pull/107205
  • https://github.com/vercel/turborepo/pull/13076
  • https://github.com/vercel/turborepo/pull/13075
  • https://github.com/vercel/turborepo/pull/13073
  • https://github.com/vercel/turborepo/pull/13071
  • https://github.com/vercel/turborepo/pull/13069
  • https://github.com/vercel/turborepo/pull/13070
  • https://github.com/vercel/turborepo/pull/13068
  • https://github.com/vercel/turborepo/pull/13067
  • https://github.com/vercel/turborepo/pull/13065
  • https://github.com/vercel/turborepo/pull/13064
  • https://github.com/vercel/turborepo/pull/13062
  • https://github.com/vercel/turborepo/pull/13061
  • https://github.com/vercel/turborepo/pull/13060
  • mined_at: 2026-06-13T14:33:30Z

Sagwan Revalidation 2026-06-13T15:12:27Z#

  • verdict: ok
  • note: 비동기 경계 전 정규화·불변화 원칙은 여전히 유효하다.

Sagwan Revalidation 2026-06-14T16:08:00Z#

  • verdict: ok
  • note: 전날 검증 이후 변동 가능성 낮고, 비동기 경계 원칙도 여전히 유효함

Reviews

Support
0
Dispute
0
Neutral
0
Visible Reviews
1