| name | async-debugging |
| description | Analyze and fix race conditions and concurrency bugs in async code. Use when debugging async bugs, fixing race conditions, resolving concurrency issues, or when shared state is accessed by multiple async operations. |
Async Debugging
๋ฒ๊ทธ ๋ถ์ ์ํฌํ๋ก์ฐ
- ์๋ณ: ์ฝ๋์์ ๊ณต์ ์ํ์ ๋ํ ๋น๋๊ธฐ ์ ๊ทผ์ ๋ชจ๋ ์ฐพ๊ธฐ
- ์๋๋ฆฌ์ค ๋์ถ: ์ด๋ค ํ์ด๋ฐ์ ๋ฌธ์ ๊ฐ ๋ฐ์ํ๋์ง ์ํ์ค ์์ฑ
- ์ํฅ ํ๊ฐ: ๊ฐ ๋ฒ๊ทธ์ ์ฌ๊ฐ๋์ ๋ฐ์ ๊ฐ๋ฅ์ฑ ํ๊ฐ
- ๋ฌธ์ํ: bug-analysis.md์ ๋ถ์ ๊ฒฐ๊ณผ ๊ธฐ๋ก
์์ ์์น
- Deduplication: pending Map์ Promise๋ฅผ ์ ์ฅํ์ฌ ๋์ผ ํค ์์ฒญ ์ค๋ณต ๋ฐฉ์ง
- Resource Cleanup: try/finally๋ก ์๋ฌ ์์๋ pending ์ํ ์ ๋ฆฌ ๋ณด์ฅ
- Atomic Operations: ์บ์ ์ญ์ ์ ์ ๊ฐ ์ค์ ์ ์์์ ์ผ๋ก ์ฒ๋ฆฌ
- Helper Extraction: ๊ณตํต fetch ๋ก์ง์ _fetch() ํฌํผ๋ก ์ถ์ถํ์ฌ DRY
์์ ์ ๋ฐ๋์
- ๋ฒ๊ทธ๋ฅผ ๋ถ์ํ๊ณ ๋ฌธ์ํํ ๊ฒ
- ์ค๋ณต ์ฝ๋๋ ํฌํผ ๋ฉ์๋๋ก ์ถ์ถํ ๊ฒ
- ํ
์คํธ๋ ๋์์ฑ ์๋๋ฆฌ์ค๋ฅผ ๋ฐ๋์ ํฌํจํ ๊ฒ
์์ธ ์ฝ๋ ํจํด์ references/patterns.md ์ฐธ์กฐ.