ground-android icon indicating copy to clipboard operation
ground-android copied to clipboard

[Code health] Catch only transient errors for retry in PhotoSyncWorker

Open shobhitagarwal1612 opened this issue 5 years ago • 4 comments

From https://github.com/google/ground-android/pull/404#discussion_r396719499

@scolsen, "it might make sense to fail against certain exceptions—not sure precisely what exceptions that function can throw, but I imagine there may be some cases that are unrecoverable, in which case it doesn't make sense to continue retry work."

shobhitagarwal1612 avatar Mar 24 '20 06:03 shobhitagarwal1612

The number of retries is bounded, so even unrecoverable errors will cause photo upload to be aborted (eventually).

gino-m avatar Feb 05 '24 16:02 gino-m

The number of retries is bounded, so even unrecoverable errors will cause photo upload to be aborted (eventually).

True, I don't think it's high priority for precisely that reason, but it feels wasteful for us to attempt any number of retries for cases which we know will never succeed, e.g. unsupported photo file type (which should happen rarely, if ever, in the first place) I think is one failure case in which it makes no sense for us to mark the work for retry as it will fail every time (the file extension for that particular unit of work will remain stable while we attempted to needlessly process it N times — that's N potential DB writes, etc. that would be happening for no good reason).

scolsen avatar Feb 05 '24 18:02 scolsen

Fair point. After all, this is a tagged as "code health", not "bug", in which case I think we could keep it open.

gino-m avatar Feb 05 '24 18:02 gino-m

Removing "Done" status based on conversation above

jcqli avatar Mar 18 '24 13:03 jcqli