Skip to content

Clean up FlareSolverr sessions after create timeouts - #463

Merged
rix1337 merged 1 commit into
mainfrom
dev
Oct 18, 2026
Merged

rix1337 merged 1 commit into
mainfrom
dev

Conversation

@rix1337

@rix1337 rix1337 commented Oct 18, 2026 •

Copy link
Copy Markdown
Owner

Fixes orphaned FlareSolverr browsers when session creation finishes after Quasarr's timeout. Every create request now carries a client-chosen ID. One background worker tracks failed creations, waits for registration, and confirms removal without extending the search timeout. Session listings are shared across queued IDs at the same endpoint, the worker serves ready endpoints round-robin by least-recently-served order, and destroy calls reserve time for the entire queue. It also handles a lost destroy response.

Cleanup retries for up to ten minutes while Quasarr is running, then logs a warning. Successful sessions remain owned by their callers. No configuration or hostname changes are required. The required pre-commit run bumped the version to 4.7.5.

Verified against the configured FlareSolverr 3.5.2 with a relay delaying create requests: the original code leaked in five of five runs; the fix cleaned up all five delayed sessions after repeated registration polls. A separate run using the normal 30-second timeout returned after 30.02 seconds and removed the late browser by 37.36 seconds. Normal creation and destruction also passed with supplied and generated IDs. No probe sessions remain.

Regression coverage includes a 201-second startup, lost destroy responses, the ten-minute deadline, and bursts of 11 and 40 sessions with slow API replies, including a URL change while an older endpoint still has pending cleanup, and a third endpoint whose single pending session is no longer postponed behind two 40-session backlogs. Five additional live trials with two concurrent timeouts each confirmed that one listing covers both sessions and both browsers are removed. All 481 tests and the full pre-commit checks passed.

Closes #462.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 18, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ⚠️ Failed 2026-10-18T12:16:21.925603Z 429c8a1 New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

chatgpt-codex-connector[bot]

This comment was marked as resolved.

@rix1337
rix1337 force-pushed the dev branch 2 times, most recently from b19198b to 2a53aaa Compare October 18, 2026 11:44

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 2a53aaa423

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread quasarr/providers/cloudflare.py Outdated
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

@rix1337
rix1337 merged commit 278c6b2 into main Oct 18, 2026
13 checks passed
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.

FlareSolverr browser leaks when sessions.create times out, because LazyFlareSolverrSession never destroys the requested session

1 participant