Project

General

Profile

Actions

Idea #20187

closed

Cache discovery doc in memory in controller

Added by Tom Clegg about 1 year ago. Updated about 1 year ago.

Status:
Resolved
Priority:
Normal
Assigned To:
Category:
API
Start date:
03/15/2023
Due date:
Story points:
1.0
Release relationship:
Auto

Description

The existing Rails disk cache is not especially efficient (it's wasteful to do a Rails request for static content) and may be unreliable (we've seen 200 status with an empty response body, possibly caused by a full temp disk).

Rather than proxy each GET /discovery/v1/apis/arvados/v1/rest request through to railsapi, controller should
  • (if not already cached) fetch the discovery doc from rails
  • ensure it's valid JSON (if not, return 502)
  • cache it in memory
  • return the cached document from now on
  • periodically refresh the cache (to pick up changes if railsapi restarts with a different config that affects the discovery doc), but while refresh is in progress/failing, continue to return the existing cached document

Subtasks 1 (0 open1 closed)

Task #20197: Review 20187-cache-discovery-docResolvedTom Clegg03/15/2023Actions

Related issues

Related to Arvados - Bug #20203: API server returns 200 OK when it can't cache a documentResolvedTom Clegg04/14/2023Actions
Actions

Also available in: Atom PDF