tools/android/loading Improve logging of failures
Adds a failure database that keeps track of various failures:
- trace generation failure,
- TaskQueue failure,
- worker.py starting up with an dirty state, most likely
because it crashed and was restarted.
The trace database is uploaded to Cloud Storage.
As part of this CL, some code from _ProcessClovisTask() is
split to a separate function _HandleTraceGenerationResults(),
to make the code cleaner.
The "autorestart" parameter for supervisor is changed
to "unexpected" so that the worker script is restarted
only if it crashed, and not if it exits cleanly.
This avoids the worker to be restarted if there are no
tasks to process, which has the side effect of triggering
a "startup_with_dirty_state" error.
The "destruct_instance_name" config field is split in
"instance_name" (string) and "self_destruct" (bool).
"trace_database_filename" is removed and is now inferred
from the instance name.
Review-Url: https://codereview.chromium.org/1930223003
Cr-Commit-Position: refs/heads/master@{#391203}