New: Begin troubleshooting shutdowns and stops that are not graceful.

Calling stop should cleanly exit the synchronizer. Instead, we are seeing lots of errors and crashes. This can be made better but the first step is to add some logs to help troubleshoot the problem.
This commit is contained in:
Kevin Gorham 2021-03-31 08:30:51 -04:00
parent c761071d6f
commit b5fc8bc8a2
No known key found for this signature in database
GPG Key ID: CCA55602DF49FC38
1 changed files with 7 additions and 0 deletions

View File

@ -255,10 +255,17 @@ class SdkSynchronizer internal constructor(
*/
override fun stop() {
coroutineScope.launch {
// log everything to help troubleshoot shutdowns that aren't graceful
twig("Synchronizer::stop: STARTING")
twig("Synchronizer::stop: processor.stop()")
processor.stop()
twig("Synchronizer::stop: coroutineScope.cancel()")
coroutineScope.cancel()
twig("Synchronizer::stop: _balances.cancel()")
_balances.cancel()
twig("Synchronizer::stop: _status.cancel()")
_status.cancel()
twig("Synchronizer::stop: COMPLETE")
}
}