serratus-bio / open-virome

monorepo for data explorer UI and APIs
http://openvirome.com/
GNU Affero General Public License v3.0
0 stars 0 forks source link

Gateway error, timeout, `/identifiers` call #82

Closed almosnow closed 1 month ago

almosnow commented 1 month ago

POST to https://zrdbegawce.execute-api.us-east-1.amazonaws.com/prod/identifiers takes a while and sometimes does not make it back in time.

almosnow commented 1 month ago

This is causing →

[from Slack]

image

The call to /identifiers times out, the rest of the code proceeds with an empty ID list, the map shows the default which is everything

almosnow commented 1 month ago

@lukepereira let me know if you have time to address this today, otherwise I can jump into it

lukepereira commented 1 month ago

the speed depends on the specific filters applied. Will need to look into if the /identifiers call is slow because of an issue with an index on the new tables or if it's just because the filter contains a really large number of runs.

In the second case, we might need to exclude non-viral runs like what we did with the geo table: https://github.com/serratus-bio/open-virome/issues/78

lukepereira commented 1 month ago

We also probably want better error handling so it displays an error on the main page instead of the previous results

lukepereira commented 1 month ago

Just saw the screenshot only has a filter for ecology. the identifiers query would need the same workaround you added to use palm_virome = True: https://github.com/serratus-bio/open-virome/blame/main/frontend/src/common/MapLibreDeckGLMap.tsx#L182

This would be best solved by creating a View for the app to use everywhere:

CREATE VIEW biosample_geo_virome AS
SELECT * FROM biosample_geographical_location 
WHERE palm_virome = true
lukepereira commented 1 month ago

Resolved the issue for geo related filters and opened another issue to improve error handling on the app: https://github.com/serratus-bio/open-virome/issues/84

Improving query speed for other filters is tracked here: https://github.com/serratus-bio/open-virome/issues/78