Files
crawl4ai/tests
unclecode 3401dd1620 Fix browser recycling under high concurrency — version-based approach
The previous recycle logic waited for all refcounts to hit 0 before
recycling, which never happened under sustained concurrent load (20+
crawls always had at least one active).

New approach:
- Add _browser_version to config signature — bump it to force new contexts
- When threshold is hit: bump version, move old sigs to _pending_cleanup
- New requests get new contexts automatically (different signature)
- Old contexts drain naturally and get cleaned up when refcount hits 0
- Safety cap: max 3 pending browsers draining at once

This means recycling now works under any load pattern — no blocking,
no waiting for quiet moments. Old and new browsers coexist briefly
during transitions.

Includes 12 new tests covering version bumps, concurrent recycling,
safety cap, and edge cases.
2026-02-05 07:48:12 +00:00
..
2025-10-22 20:41:06 +08:00
2025-02-28 19:53:35 +08:00
2025-10-22 20:41:06 +08:00
2024-05-14 21:27:41 +08:00
2025-01-13 19:19:58 +08:00
2025-04-29 16:26:35 +02:00
2025-01-13 19:19:58 +08:00
2025-04-29 16:26:35 +02:00
2025-02-28 19:53:35 +08:00