Conversation
`asyncio.to_thread`의 기본 executor는 여러 워커에 작업을 분배하는데, trawl 파이프라인이 쓰는 sync_playwright의 greenlet 디스패처는 최초 호출 스레드에 핀되므로 다른 워커로 들어온 호출이 "Cannot switch to a different thread" greenlet.error를 뱉었다. max_workers=1인 전용 ThreadPoolExecutor로 모든 fetch_page / profile_page 호출을 동일 스레드에 고정해 이 간헐적 실패를 제거한다.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
src/trawl_mcp/server.py의 파이프라인 호출을 전용 단일 워커 스레드에 고정하여 이벤트 루프 블로킹/스레드 경합 이슈를 방지Test plan
python tests/test_pipeline.py— 파리티 매트릭스 12/12python tests/test_mcp_server.py— stdio 프로토콜 스모크