Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't accurately determine "Download Finished" state. Inconsistent API download status #2222

Open
barribarrier opened this issue Nov 1, 2023 · 0 comments

Comments

@barribarrier
Copy link

barribarrier commented Nov 1, 2023

In our application UI, we want to show user the current update status:

  1. Downloading
  2. Download finished

How would one accurately determine whether the new release has finished downloading (2)? (Assume there's a lockfile already created so supervisor won't install the update)

I've discovered two ways, but each have problem (bug?):

1. Polling /v2/application/state

Problem: API reports all services as "Downloaded" in the middle of download.
Log:

// Context: The new release (a2620a4c47d6402ce31874a7b42f1a82) adds a new service "super-logger" and updates "database", "embedded" services. "video" service is unchanged.

// Idle
2023-10-31 12:18:31:  {"test-fleet":{"appId":2004717,"commit":"880e9be796fb820699fde61dd334b438","services":{"database":{"status":"Running","releaseId":2769991,"downloadProgress":null},"embedded":{"status":"Running","releaseId":2769991,"downloadProgress":null},"video":{"status":"Running","releaseId":2769991,"downloadProgress":null}}}}
2023-10-31 12:18:32:  {"test-fleet":{"appId":2004717,"commit":"880e9be796fb820699fde61dd334b438","services":{"database":{"status":"Running","releaseId":2769991,"downloadProgress":null},"embedded":{"status":"Running","releaseId":2769991,"downloadProgress":null},"video":{"status":"Running","releaseId":2769991,"downloadProgress":null}}}}

// Download starts
2023-10-31 12:18:34:  {"test-fleet":{"appId":2004717,"commit":"a2620a4c47d6402ce31874a7b42f1a82","services":{"video":{"status":"Downloaded","releaseId":2771256,"downloadProgress":null}}}}
2023-10-31 12:18:36:  {"test-fleet":{"appId":2004717,"commit":"a2620a4c47d6402ce31874a7b42f1a82","services":{"embedded":{"status":"Downloading","releaseId":2771256,"downloadProgress":null},"video":{"status":"Downloaded","releaseId":2771256,"downloadProgress":null},"super-logger":{"status":"Downloading","releaseId":2771256,"downloadProgress":null}}}}
2023-10-31 12:18:38:  {"test-fleet":{"appId":2004717,"commit":"a2620a4c47d6402ce31874a7b42f1a82","services":{"embedded":{"status":"Downloading","releaseId":2771256,"downloadProgress":null},"video":{"status":"Downloaded","releaseId":2771256,"downloadProgress":null},"super-logger":{"status":"Downloading","releaseId":2771256,"downloadProgress":null}}}}
2023-10-31 12:18:40:  {"test-fleet":{"appId":2004717,"commit":"a2620a4c47d6402ce31874a7b42f1a82","services":{"embedded":{"status":"Downloading","releaseId":2771256,"downloadProgress":null},"video":{"status":"Downloaded","releaseId":2771256,"downloadProgress":null},"super-logger":{"status":"Downloading","releaseId":2771256,"downloadProgress":null}}}}
2023-10-31 12:18:41:  {"test-fleet":{"appId":2004717,"commit":"a2620a4c47d6402ce31874a7b42f1a82","services":{"embedded":{"status":"Downloading","releaseId":2771256,"downloadProgress":null},"video":{"status":"Downloaded","releaseId":2771256,"downloadProgress":null},"super-logger":{"status":"Downloading","releaseId":2771256,"downloadProgress":null}}}}
2023-10-31 12:18:42:  {"test-fleet":{"appId":2004717,"commit":"a2620a4c47d6402ce31874a7b42f1a82","services":{"embedded":{"status":"Downloading","releaseId":2771256,"downloadProgress":null},"video":{"status":"Downloaded","releaseId":2771256,"downloadProgress":null},"super-logger":{"status":"Downloading","releaseId":2771256,"downloadProgress":93}}}}
2023-10-31 12:18:44:  {"test-fleet":{"appId":2004717,"commit":"a2620a4c47d6402ce31874a7b42f1a82","services":{"embedded":{"status":"Downloading","releaseId":2771256,"downloadProgress":1},"video":{"status":"Downloaded","releaseId":2771256,"downloadProgress":null},"super-logger":{"status":"Downloading","releaseId":2771256,"downloadProgress":100}}}}
2023-10-31 12:18:46:  {"test-fleet":{"appId":2004717,"commit":"a2620a4c47d6402ce31874a7b42f1a82","services":{"embedded":{"status":"Downloading","releaseId":2771256,"downloadProgress":96},"video":{"status":"Downloaded","releaseId":2771256,"downloadProgress":null},"super-logger":{"status":"Downloaded","releaseId":2771256,"downloadProgress":null}}}}
2023-10-31 12:18:47:  {"test-fleet":{"appId":2004717,"commit":"a2620a4c47d6402ce31874a7b42f1a82","services":{"embedded":{"status":"Downloading","releaseId":2771256,"downloadProgress":96},"video":{"status":"Downloaded","releaseId":2771256,"downloadProgress":null},"super-logger":{"status":"Downloaded","releaseId":2771256,"downloadProgress":null}}}}

// Here it starts reporting all services status as "Downloaded". Is the download finished?
2023-10-31 12:18:49:  {"test-fleet":{"appId":2004717,"commit":"a2620a4c47d6402ce31874a7b42f1a82","services":{"embedded":{"status":"Downloaded","releaseId":2771256,"downloadProgress":null},"video":{"status":"Downloaded","releaseId":2771256,"downloadProgress":null},"super-logger":{"status":"Downloaded","releaseId":2771256,"downloadProgress":null}}}}
2023-10-31 12:18:50:  {"test-fleet":{"appId":2004717,"commit":"a2620a4c47d6402ce31874a7b42f1a82","services":{"embedded":{"status":"Downloaded","releaseId":2771256,"downloadProgress":null},"video":{"status":"Downloaded","releaseId":2771256,"downloadProgress":null},"super-logger":{"status":"Downloaded","releaseId":2771256,"downloadProgress":null}}}}
2023-10-31 12:18:51:  {"test-fleet":{"appId":2004717,"commit":"a2620a4c47d6402ce31874a7b42f1a82","services":{"embedded":{"status":"Downloaded","releaseId":2771256,"downloadProgress":null},"video":{"status":"Downloaded","releaseId":2771256,"downloadProgress":null},"super-logger":{"status":"Downloaded","releaseId":2771256,"downloadProgress":null}}}}
2023-10-31 12:18:53:  {"test-fleet":{"appId":2004717,"commit":"a2620a4c47d6402ce31874a7b42f1a82","services":{"embedded":{"status":"Downloaded","releaseId":2771256,"downloadProgress":null},"video":{"status":"Downloaded","releaseId":2771256,"downloadProgress":null},"super-logger":{"status":"Downloaded","releaseId":2771256,"downloadProgress":null}}}}

// Nope, "database" service starts downloading
2023-10-31 12:18:55:  {"test-fleet":{"appId":2004717,"commit":"a2620a4c47d6402ce31874a7b42f1a82","services":{"database":{"status":"Downloading","releaseId":2771256,"downloadProgress":null},"embedded":{"status":"Downloaded","releaseId":2771256,"downloadProgress":null},"video":{"status":"Downloaded","releaseId":2771256,"downloadProgress":null},"super-logger":{"status":"Downloaded","releaseId":2771256,"downloadProgress":null}}}}
2023-10-31 12:18:56:  {"test-fleet":{"appId":2004717,"commit":"a2620a4c47d6402ce31874a7b42f1a82","services":{"database":{"status":"Downloading","releaseId":2771256,"downloadProgress":null},"embedded":{"status":"Downloaded","releaseId":2771256,"downloadProgress":null},"video":{"status":"Downloaded","releaseId":2771256,"downloadProgress":null},"super-logger":{"status":"Downloaded","releaseId":2771256,"downloadProgress":null}}}}
2023-10-31 12:18:57:  {"test-fleet":{"appId":2004717,"commit":"a2620a4c47d6402ce31874a7b42f1a82","services":{"database":{"status":"Downloading","releaseId":2771256,"downloadProgress":null},"embedded":{"status":"Downloaded","releaseId":2771256,"downloadProgress":null},"video":{"status":"Downloaded","releaseId":2771256,"downloadProgress":null},"super-logger":{"status":"Downloaded","releaseId":2771256,"downloadProgress":null}}}}
2023-10-31 12:18:59:  {"test-fleet":{"appId":2004717,"commit":"a2620a4c47d6402ce31874a7b42f1a82","services":{"database":{"status":"Downloading","releaseId":2771256,"downloadProgress":null},"embedded":{"status":"Downloaded","releaseId":2771256,"downloadProgress":null},"video":{"status":"Downloaded","releaseId":2771256,"downloadProgress":null},"super-logger":{"status":"Downloaded","releaseId":2771256,"downloadProgress":null}}}}
2023-10-31 12:19:00:  {"test-fleet":{"appId":2004717,"commit":"a2620a4c47d6402ce31874a7b42f1a82","services":{"database":{"status":"Downloading","releaseId":2771256,"downloadProgress":null},"embedded":{"status":"Downloaded","releaseId":2771256,"downloadProgress":null},"video":{"status":"Downloaded","releaseId":2771256,"downloadProgress":null},"super-logger":{"status":"Downloaded","releaseId":2771256,"downloadProgress":null}}}}
2023-10-31 12:19:01:  {"test-fleet":{"appId":2004717,"commit":"a2620a4c47d6402ce31874a7b42f1a82","services":{"database":{"status":"Downloading","releaseId":2771256,"downloadProgress":null},"embedded":{"status":"Downloaded","releaseId":2771256,"downloadProgress":null},"video":{"status":"Downloaded","releaseId":2771256,"downloadProgress":null},"super-logger":{"status":"Downloaded","releaseId":2771256,"downloadProgress":null}}}}
2023-10-31 12:19:03:  {"test-fleet":{"appId":2004717,"commit":"a2620a4c47d6402ce31874a7b42f1a82","services":{"database":{"status":"Downloading","releaseId":2771256,"downloadProgress":93},"embedded":{"status":"Downloaded","releaseId":2771256,"downloadProgress":null},"video":{"status":"Downloaded","releaseId":2771256,"downloadProgress":null},"super-logger":{"status":"Downloaded","releaseId":2771256,"downloadProgress":null}}}}
2023-10-31 12:19:04:  {"test-fleet":{"appId":2004717,"commit":"a2620a4c47d6402ce31874a7b42f1a82","services":{"database":{"status":"Downloading","releaseId":2771256,"downloadProgress":93},"embedded":{"status":"Downloaded","releaseId":2771256,"downloadProgress":null},"video":{"status":"Downloaded","releaseId":2771256,"downloadProgress":null},"super-logger":{"status":"Downloaded","releaseId":2771256,"downloadProgress":null}}}}
2023-10-31 12:19:05:  {"test-fleet":{"appId":2004717,"commit":"a2620a4c47d6402ce31874a7b42f1a82","services":{"database":{"status":"Downloading","releaseId":2771256,"downloadProgress":93},"embedded":{"status":"Downloaded","releaseId":2771256,"downloadProgress":null},"video":{"status":"Downloaded","releaseId":2771256,"downloadProgress":null},"super-logger":{"status":"Downloaded","releaseId":2771256,"downloadProgress":null}}}}
2023-10-31 12:19:07:  {"test-fleet":{"appId":2004717,"commit":"a2620a4c47d6402ce31874a7b42f1a82","services":{"database":{"status":"Downloading","releaseId":2771256,"downloadProgress":93},"embedded":{"status":"Downloaded","releaseId":2771256,"downloadProgress":null},"video":{"status":"Downloaded","releaseId":2771256,"downloadProgress":null},"super-logger":{"status":"Downloaded","releaseId":2771256,"downloadProgress":null}}}}
2023-10-31 12:19:08:  {"test-fleet":{"appId":2004717,"commit":"a2620a4c47d6402ce31874a7b42f1a82","services":{"database":{"status":"Downloading","releaseId":2771256,"downloadProgress":100},"embedded":{"status":"Downloaded","releaseId":2771256,"downloadProgress":null},"video":{"status":"Downloaded","releaseId":2771256,"downloadProgress":null},"super-logger":{"status":"Downloaded","releaseId":2771256,"downloadProgress":null}}}}

// Download actually finished
2023-10-31 12:19:09:  {"test-fleet":{"appId":2004717,"commit":"a2620a4c47d6402ce31874a7b42f1a82","services":{"embedded":{"status":"Downloaded","releaseId":2771256,"downloadProgress":null},"database":{"status":"Downloaded","releaseId":2771256,"downloadProgress":null},"video":{"status":"Downloaded","releaseId":2771256,"downloadProgress":null},"super-logger":{"status":"Downloaded","releaseId":2771256,"downloadProgress":null}}}}
2023-10-31 12:19:12:  {"test-fleet":{"appId":2004717,"commit":"a2620a4c47d6402ce31874a7b42f1a82","services":{"database":{"status":"Downloaded","releaseId":2771256,"downloadProgress":null},"embedded":{"status":"Downloaded","releaseId":2771256,"downloadProgress":null},"video":{"status":"Downloaded","releaseId":2771256,"downloadProgress":null},"super-logger":{"status":"Running","releaseId":2771256,"downloadProgress":null}}}}
2023-10-31 12:19:14:  {"test-fleet":{"appId":2004717,"commit":"a2620a4c47d6402ce31874a7b42f1a82","services":{"database":{"status":"Downloaded","releaseId":2771256,"downloadProgress":null},"embedded":{"status":"Downloaded","releaseId":2771256,"downloadProgress":null},"video":{"status":"Downloaded","releaseId":2771256,"downloadProgress":null},"super-logger":{"status":"Running","releaseId":2771256,"downloadProgress":null}}}}
2023-10-31 12:19:15:  {"test-fleet":{"appId":2004717,"commit":"a2620a4c47d6402ce31874a7b42f1a82","services":{"database":{"status":"Downloaded","releaseId":2771256,"downloadProgress":null},"embedded":{"status":"Downloaded","releaseId":2771256,"downloadProgress":null},"video":{"status":"Downloaded","releaseId":2771256,"downloadProgress":null},"super-logger":{"status":"Running","releaseId":2771256,"downloadProgress":null}}}}
2023-10-31 12:19:17:  {"test-fleet":{"appId":2004717,"commit":"a2620a4c47d6402ce31874a7b42f1a82","services":{"database":{"status":"Downloaded","releaseId":2771256,"downloadProgress":null},"embedded":{"status":"Downloaded","releaseId":2771256,"downloadProgress":null},"video":{"status":"Downloaded","releaseId":2771256,"downloadProgress":null},"super-logger":{"status":"Running","releaseId":2771256,"downloadProgress":null}}}}
2023-10-31 12:19:18:  {"test-fleet":{"appId":2004717,"commit":"a2620a4c47d6402ce31874a7b42f1a82","services":{"database":{"status":"Downloaded","releaseId":2771256,"downloadProgress":null},"embedded":{"status":"Downloaded","releaseId":2771256,"downloadProgress":null},"video":{"status":"Downloaded","releaseId":2771256,"downloadProgress":null},"super-logger":{"status":"Running","releaseId":2771256,"downloadProgress":null}}}}
2023-10-31 12:19:20:  {"test-fleet":{"appId":2004717,"commit":"a2620a4c47d6402ce31874a7b42f1a82","services":{"database":{"status":"Downloaded","releaseId":2771256,"downloadProgress":null},"embedded":{"status":"Downloaded","releaseId":2771256,"downloadProgress":null},"video":{"status":"Downloaded","releaseId":2771256,"downloadProgress":null},"super-logger":{"status":"Running","releaseId":2771256,"downloadProgress":null}}}}
2023-10-31 12:19:21:  {"test-fleet":{"appId":2004717,"commit":"a2620a4c47d6402ce31874a7b42f1a82","services":{"database":{"status":"Downloaded","releaseId":2771256,"downloadProgress":null},"embedded":{"status":"Downloaded","releaseId":2771256,"downloadProgress":null},"video":{"status":"Downloaded","releaseId":2771256,"downloadProgress":null},"super-logger":{"status":"Running","releaseId":2771256,"downloadProgress":null}}}}
2023-10-31 12:19:23:  {"test-fleet":{"appId":2004717,"commit":"a2620a4c47d6402ce31874a7b42f1a82","services":{"database":{"status":"Downloaded","releaseId":2771256,"downloadProgress":null},"embedded":{"status":"Downloaded","releaseId":2771256,"downloadProgress":null},"video":{"status":"Downloaded","releaseId":2771256,"downloadProgress":null},"super-logger":{"status":"Running","releaseId":2771256,"downloadProgress":null}}}}
2023-10-31 12:19:24:  {"test-fleet":{"appId":2004717,"commit":"a2620a4c47d6402ce31874a7b42f1a82","services":{"database":{"status":"Downloaded","releaseId":2771256,"downloadProgress":null},"embedded":{"status":"Downloaded","releaseId":2771256,"downloadProgress":null},"video":{"status":"Downloaded","releaseId":2771256,"downloadProgress":null},"super-logger":{"status":"Running","releaseId":2771256,"downloadProgress":null}}}}
2023-10-31 12:19:26:  {"test-fleet":{"appId":2004717,"commit":"a2620a4c47d6402ce31874a7b42f1a82","services":{"database":{"status":"Downloaded","releaseId":2771256,"downloadProgress":null},"embedded":{"status":"Downloaded","releaseId":2771256,"downloadProgress":null},"video":{"status":"Downloaded","releaseId":2771256,"downloadProgress":null},"super-logger":{"status":"Running","releaseId":2771256,"downloadProgress":null}}}}
2023-10-31 12:19:27:  {"test-fleet":{"appId":2004717,"commit":"a2620a4c47d6402ce31874a7b42f1a82","services":{"database":{"status":"Downloaded","releaseId":2771256,"downloadProgress":null},"embedded":{"status":"Downloaded","releaseId":2771256,"downloadProgress":null},"video":{"status":"Downloaded","releaseId":2771256,"downloadProgress":null},"super-logger":{"status":"Running","releaseId":2771256,"downloadProgress":null}}}}
2023-10-31 12:19:29:  {"test-fleet":{"appId":2004717,"commit":"a2620a4c47d6402ce31874a7b42f1a82","services":{"database":{"status":"Downloaded","releaseId":2771256,"downloadProgress":null},"embedded":{"status":"Downloaded","releaseId":2771256,"downloadProgress":null},"video":{"status":"Downloaded","releaseId":2771256,"downloadProgress":null},"super-logger":{"status":"Running","releaseId":2771256,"downloadProgress":null}}}}
2023-10-31 12:19:30:  {"test-fleet":{"appId":2004717,"commit":"a2620a4c47d6402ce31874a7b42f1a82","services":{"database":{"status":"Downloaded","releaseId":2771256,"downloadProgress":null},"embedded":{"status":"Downloaded","releaseId":2771256,"downloadProgress":null},"video":{"status":"Downloaded","releaseId":2771256,"downloadProgress":null},"super-logger":{"status":"Running","releaseId":2771256,"downloadProgress":null}}}}
2023-10-31 12:19:31:  {"test-fleet":{"appId":2004717,"commit":"a2620a4c47d6402ce31874a7b42f1a82","services":{"database":{"status":"Downloaded","releaseId":2771256,"downloadProgress":null},"embedded":{"status":"Downloaded","releaseId":2771256,"downloadProgress":null},"video":{"status":"Downloaded","releaseId":2771256,"downloadProgress":null},"super-logger":{"status":"Running","releaseId":2771256,"downloadProgress":null}}}}
2023-10-31 12:19:33:  {"test-fleet":{"appId":2004717,"commit":"a2620a4c47d6402ce31874a7b42f1a82","services":{"database":{"status":"Downloaded","releaseId":2771256,"downloadProgress":null},"embedded":{"status":"Downloaded","releaseId":2771256,"downloadProgress":null},"video":{"status":"Downloaded","releaseId":2771256,"downloadProgress":null},"super-logger":{"status":"Running","releaseId":2771256,"downloadProgress":null}}}}
2023-10-31 12:19:34:  {"test-fleet":{"appId":2004717,"commit":"a2620a4c47d6402ce31874a7b42f1a82","services":{"database":{"status":"Downloaded","releaseId":2771256,"downloadProgress":null},"embedded":{"status":"Downloaded","releaseId":2771256,"downloadProgress":null},"video":{"status":"Downloaded","releaseId":2771256,"downloadProgress":null},"super-logger":{"status":"Running","releaseId":2771256,"downloadProgress":null}}}}
2023-10-31 12:19:36:  {"test-fleet":{"appId":2004717,"commit":"a2620a4c47d6402ce31874a7b42f1a82","services":{"database":{"status":"Downloaded","releaseId":2771256,"downloadProgress":null},"embedded":{"status":"Downloaded","releaseId":2771256,"downloadProgress":null},"video":{"status":"Downloaded","releaseId":2771256,"downloadProgress":null},"super-logger":{"status":"Running","releaseId":2771256,"downloadProgress":null}}}}
2023-10-31 12:19:37:  {"test-fleet":{"appId":2004717,"commit":"a2620a4c47d6402ce31874a7b42f1a82","services":{"database":{"status":"Downloaded","releaseId":2771256,"downloadProgress":null},"embedded":{"status":"Downloaded","releaseId":2771256,"downloadProgress":null},"video":{"status":"Downloaded","releaseId":2771256,"downloadProgress":null},"super-logger":{"status":"Running","releaseId":2771256,"downloadProgress":null}}}}
2023-10-31 12:19:39:  {"test-fleet":{"appId":2004717,"commit":"a2620a4c47d6402ce31874a7b42f1a82","services":{"database":{"status":"Downloaded","releaseId":2771256,"downloadProgress":null},"embedded":{"status":"Downloaded","releaseId":2771256,"downloadProgress":null},"video":{"status":"Downloaded","releaseId":2771256,"downloadProgress":null},"super-logger":{"status":"Running","releaseId":2771256,"downloadProgress":null}}}}

2. Polling v2/state/status

Problem: API reports all images as "Downloaded" in the middle of download.
Log: https://rentry.co/m7v3h (CTRL+F "//" for relevant comments)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant