background-fetch
background-fetch copied to clipboard
Potential race with "Increment settledFetches by 1."
Since this is done in parallel, it seems two threads could read settledFetches at a similar time, then increment it locally, and write out the result, leading to it only being incremented once rather than twice.
I was hoping by using "increment" it would be clear that this should be atomic, but I'm happy to define incrementing using parallel queues.
Yeah, once we have numbers defined we should really define this in Infra. Atomic makes sense, but if someone needs to increment by 2 and copies this pattern...
if someone needs to increment by 2
This is pretty much what "complete a record" appears to be doing with "uploaded".