Skip to content

perf(search): throttle provider search concurrency with Semaphore and… - #3345

Open
Iyyappan-15 wants to merge 2 commits into
recloudstream:masterfrom
Iyyappan-15:perf/search-concurrency-limiter
Open

Iyyappan-15 wants to merge 2 commits into
recloudstream:masterfrom
Iyyappan-15:perf/search-concurrency-limiter

Conversation

@Iyyappan-15

Copy link
Copy Markdown

… configurable timeout

Throttles concurrent provider searches using a Semaphore (default 10) and per-provider timeout (default 8s) to prevent OOM and socket exhaustion on Android TV and low-RAM devices. Exposes user-configurable options in Settings > Providers and includes unit tests in SearchConcurrencyTest.

… configurable timeout

Throttles concurrent provider searches using a Semaphore (default 10) and per-provider timeout (default 8s) to prevent OOM and socket exhaustion on Android TV and low-RAM devices. Exposes user-configurable options in Settings > Providers and includes unit tests in SearchConcurrencyTest.
@fire-light42

Copy link
Copy Markdown
Collaborator

Please state your usage of AI as per our AI policy.

@fire-light42 fire-light42 added the Review needed The pull request contains no obvious blockers. It just needs a review before merging. label Nov 26, 2026
@Iyyappan-15

Copy link
Copy Markdown
Author

AI Usage Disclosure (as per AI-POLICY.md)

This pull request was developed with the assistance of an AI assistant (Google Gemini / Antigravity).

What the AI Assisted With:

• Identifying the unbounded parallel search fan-out issue as a potential cause of Out-of-Memory (OOM) crashes on low-RAM devices.
• Suggesting Kotlin's Semaphore and withTimeoutOrNull as a solution to control concurrency and prevent excessive resource consumption.
• Providing initial code suggestions for the changes to SearchViewModel.kt and the additions to the Settings XML.

What I Personally Did:

• Reviewed and understood the existing SearchViewModel.kt and ParCollections.kt implementations to ensure the proposed solution aligned with the project's architecture.
• Carefully reviewed every line of AI-generated code for correctness, compatibility, and consistency with existing project conventions.
• Verified that the changes preserve existing search functionality and do not introduce regressions.
• Independently wrote and validated the SearchConcurrencyTest.kt unit tests.
• Ensured that all modifications comply with Kotlin Multiplatform (KMP) compatibility requirements.

Final Responsibility:

AI was used strictly as a development aid. I personally reviewed, understood, tested and validated all changes before submitting this pull request.

@fire-light42 fire-light42 added the AI Assisted This pull request was AI assisted (or generated). label Nov 27, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

AI Assisted This pull request was AI assisted (or generated). Review needed The pull request contains no obvious blockers. It just needs a review before merging.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants