Skip to content

fix: high concurrency issue with 503 context closure#165

Closed
bbbugg wants to merge 3 commits into
mainfrom
fix/高并发

Hidden character warning

The head ref may contain hidden characters: "fix/\u9ad8\u5e76\u53d1"
Closed

fix: high concurrency issue with 503 context closure#165
bbbugg wants to merge 3 commits into
mainfrom
fix/高并发

Conversation

@bbbugg
Copy link
Copy Markdown
Member

@bbbugg bbbugg commented May 12, 2026

No description provided.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR aims to prevent browser context closures from disrupting in-flight requests under high concurrency by deferring context pool removals until a given account’s active request message queues have drained.

Changes:

  • Wire RequestHandler.isSystemBusy into BrowserManager via a provider callback to avoid rebalancing during busy periods.
  • Track active message-queue counts per auth index and emit an authQueuesDrained event when an account’s queues reach zero.
  • Add “defer context close until idle” logic in BrowserManager for pool pre-cleanup and rebalance, including cancel/flush of pending closures.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.

File Description
src/core/ProxyServerSystem.js Connects RequestHandler.isSystemBusy into BrowserManager to skip rebalance when busy.
src/core/ConnectionRegistry.js Adds per-auth queue counting + emits authQueuesDrained when queues drain.
src/core/BrowserManager.js Defers context closures until queues drain; cancels/flushes pending closures; adjusts pool occupancy check.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/core/ConnectionRegistry.js
Comment thread src/core/ConnectionRegistry.js
Comment thread src/core/ConnectionRegistry.js
Comment thread src/core/BrowserManager.js
@bbbugg bbbugg closed this May 12, 2026
@bbbugg bbbugg deleted the fix/高并发 branch May 12, 2026 09:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants