Commit 70309d9
fix: Prevent list modification during iteration in BrowserPool (#1703)
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>
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>1 parent 9737752 commit 70309d9
1 file changed
+2
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
346 | 346 | | |
347 | 347 | | |
348 | 348 | | |
349 | | - | |
| 349 | + | |
350 | 350 | | |
351 | 351 | | |
352 | 352 | | |
353 | 353 | | |
354 | 354 | | |
355 | 355 | | |
356 | | - | |
| 356 | + | |
357 | 357 | | |
358 | 358 | | |
359 | 359 | | |
0 commit comments