Project

General

Profile

Actions

Bug #5074

closed

[SDKs] CLI client and Ruby SDK should recover from (and avoid creating) unreadable discovery doc cache files.

Added by Tom Clegg almost 10 years ago. Updated almost 10 years ago.

Status:
Resolved
Priority:
Normal
Assigned To:
Category:
SDKs
Target version:
Story points:
0.5

Description

The current code creates a race condition while writing a file. It should create a temp file, write it, flush/close it, and rename it into place. If anything fails, it should delete the temp file.

Additionally, if a cache file exists (and is new enough, etc.) but is unreadable or unparseable, the SDK crashes. Instead, it should print a warning, then retrieve the discovery document from the server and continue.

See source:sdk/cli/bin/arv#L55 and source:sdk/ruby/lib/arvados.rb#L108

Bonus points: de-duplicate this copy-and-pasted code!


Subtasks 1 (0 open1 closed)

Task #5091: Review 5074-ruby-sdk-discovery-cache-wipResolvedPeter Amstutz01/27/2015Actions
Actions

Also available in: Atom PDF