Repository navigation
NickAkhmetov/Implement error handling for API timeouts and improve connection management - #4096
Conversation
john-conroy
left a comment
There was a problem hiding this comment.
Do we need to update the error pages?
|
@john-conroy Yes, good catch. The new 502 and 503 handlers render the React error page, but its title map in |
…gement - Show a 504 Gateway Timeout page for upstream API timeouts, and 502/503 pages for unreachable/unavailable APIs. - Reuse connections to search, entity, and assets APIs to prevent indefinite hanging requests.
The new Flask 502 and 503 handlers render the React error page, which only had titles for 504 and below, so those pages fell through to "Unexpected Error". Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
9d78e8d to
1b79924
Compare
john-conroy
left a comment
There was a problem hiding this comment.
Thanks for addressing my previous comments.
Not directly impacted by this PR, but _get_sitemap_entities_cached and _get_publication_data_types_and_organs will cache an errored result. Both catch the exception and return an empty value ([] and ([], [])), and @cache (functools.cache) stores that like a normal result.
The login, logout and group-lookup calls to Globus now pass EXTERNAL_REQUEST_TIMEOUT, so a hung call can't hold a gthread worker indefinitely. test_503_html_page covers the new service_unavailable handler. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Good catch. This is fixed in #4107: |
Summary
portal-visualization[full]to>=0.5.14, which adds the shared session and request timeouts this branch depends on.Design Documentation/Original Tickets
N/A
Testing
Added unit tests, adjusted mocks so that requests are properly scoped by session
Screenshots/Video
Include screenshots or video demonstrating any significant visual or behavioral changes.
Checklist
CHANGELOG-your-feature-name-here.mdis present in the root directory, describing the change(s) in full sentences.Additional Notes
Depends on x-atlas-consortia/portal-visualization#157, released as portal-visualization 0.5.14.
🤖 Generated with Claude Code