Repository navigation
Conversation
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Active issues can omit phenotype genes during concurrent BigBed lookups and incorrectly suspend the search service for 60 seconds after a status-0 failure when timeouts are disabled.
2 open issues
What changed in this PR
This PR limits search-service delays during startup and navigation, while reducing repeated waits and duplicate feature-file loads.
Changes:
- Applies a configurable 5-second default timeout to search services and pauses retries for 60 seconds after a detected timeout.
- Batches QTL gene lookups four at a time and shares in-flight loads for non-indexed searchable tracks.
- Adds tests for service cooldown and immediate status-0 failures.
| File | Description |
|---|---|
test/testSearch.js |
Tests timeout cooldown, retry behavior, and immediate failures. |
js/searchFeatures.js |
Adds the default timeout and service cooldown tracking. |
js/qtl/qtlTrack.js |
Batches phenotype gene lookups and isolates lookup failures. |
js/igv.d.ts |
Declares the optional search timeout setting. |
js/feature/textFeatureSource.js |
Shares file loads between concurrent searches. |
js/browser.js |
Passes the configured timeout to the search service. |
Review effort: Balanced
| const terms = [...genes] | ||
| const features = [] | ||
| for (let i = 0; i < terms.length; i += 4) { | ||
| const lookups = terms.slice(i, i + 4).map(term => searchFeatures(this.browser, term).catch(() => undefined)) |
| // A timeout says nothing about this term, so the miss is not remembered, the service is rested instead. | ||
| // A timeout has status 0, but so does a response blocked by CORS, which can be the answer for a single | ||
| // term; the time taken tells them apart. | ||
| if (error && error.status === 0 && Date.now() - requestTime >= timeout) { |
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
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.

A locus search that falls through to the web service waits for it, so a slow or unreachable service delays startup and navigation. This raises the timeout and limits how often it is paid.
Changes
config.searchpreviously got no timeout at all, so a hung service blocked the search indefinitely.config.search.timeoutoverrides the default (added toigv.d.ts); 0 turns the timeout off.searchFeatureslogs that the service is not available and callers ofsearchWebServicecan tell "not searched" from "not found".qtlTrack.js) instead of one after another. All at once would queue requests in the browser long enough to time out. A lookup that fails only loses that gene.TextFeatureSource.searchshares the whole-file load of a non-indexed searchable track.BWReadershares the load of a bigBed's search trees, and does not expose them until all are loaded. Before, a search that started while another was loading the trees saw an empty list and returned nothing. That bug predates this PR.Behaviour to be aware of
search.timeoutis set. This should go in the release notes.Testing
New tests:
test/testSearch.js: a service that times out is requested once, skipped, and tried again after the rest interval, with a timeout always set; a status-0 failure that returns at once does not rest the service, nor does any failure with the timeout turned off.test/testBigbed.js: four concurrent searches on a fresh bigBed reader all find their feature. This fails without theBWReaderchange.The bigBed, search, chrom alias and UCSC suites pass. The QTL change and the shared text-file load have no test, and none of this was tried in a browser.
🤖 Generated with Claude Code