fix: Prevent list modification during iteration in BrowserPool by vdusek · Pull Request #1703 · apify/crawlee-python
Both `_identify_inactive_browsers` and `_close_inactive_browsers` methods were modifying their respective lists (`_active_browsers` and `_inactive_browsers`) while iterating over them. This is a classic bug that can cause items to be skipped or raise RuntimeError. The fix iterates over a copy of the list (`list(...)`) while modifying the original, ensuring all items are properly processed. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
added
t-tooling
labels
Jan 30, 2026
Pijukatel
deleted the
fix/browser-pool-list-iteration-race
branch
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