google / ground-android

Ground mobile data collection app for Android
http://groundplatform.org
Apache License 2.0
244 stars 119 forks source link

Non-fatal Exception: kotlinx.coroutines.JobCancellationException #2854

Open gino-m opened 5 days ago

gino-m commented 5 days ago

This has been logged in prod 319 times in the past 7 days. There are some potentially useful log lines under "Logs & Breadcrumbs", primarily related to:

shobhitagarwal1612 commented 2 days ago

This exception occurs when the coroutine is cancelled via job.cancel() or due to a timeout. It is automatically propagated to all it's child coroutines to cancel everything as expected. Therefore, we shouldn't be logging it as an exception.

shobhitagarwal1612 commented 2 days ago

On further debugging, I found that it happens when calling await() if the job is already cancelled. So, handling this more gracefully will prevent this exception from getting thrown.