Fix Omnicorp concurrency#96
Merged
Merged
Conversation
The omnicorp overlay was CPU-bound work disguised as async: omnicorp_overlay and its helpers were declared async but contained no real await points, so a single large task monopolized the event loop and starved the poll loop, heartbeat, and other in-flight tasks until it finished. Mirror the aragorn_score worker: make the overlay synchronous and dispatch it to a ProcessPoolExecutor via run_in_executor, keeping DB load/save on the loop. This gives true multi-core parallelism and keeps the loop responsive while a long overlay runs. Cap the in-flight task limit since each message can be large. Tests updated to call the now-synchronous helpers directly.
Large queries (>=100k curie pairs) degrade into disk-bound random LMDB reads, pushing the shared-count overlay from seconds to 45 minutes-3 hours. Short-circuit those queries: once the pair count meets the OMNICORP_MAX_CURIE_PAIRS threshold (default 100000, env-overridable), return the message without the literature co-occurrence overlay. https://claude.ai/code/session_01DH9CbmVwia8eW6qkxz5MVP
Codecov Report❌ Patch coverage is
Continue to review full report in Codecov by Harness.
🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.