@@ -441,6 +441,7 @@ private async Task<SyncSessionControllerStateModel> UpdateState(MutagenClient cl
441
441
/// </summary>
442
442
private async Task < MutagenClient > EnsureDaemon ( CancellationToken ct )
443
443
{
444
+ _logger . LogDebug ( "EnsureDaemon called" ) ;
444
445
ObjectDisposedException . ThrowIf ( _disposing , typeof ( MutagenController ) ) ;
445
446
if ( _mutagenClient != null && _daemonProcess != null )
446
447
return _mutagenClient ;
@@ -479,12 +480,14 @@ private async Task<MutagenClient> EnsureDaemon(CancellationToken ct)
479
480
/// </summary>
480
481
private async Task < MutagenClient > StartDaemon ( CancellationToken ct )
481
482
{
483
+ _logger . LogDebug ( "StartDaemon called" ) ;
482
484
// Stop the running daemon
483
485
if ( _daemonProcess != null ) await StopDaemon ( ct ) ;
484
486
485
487
// Attempt to stop any orphaned daemon
486
488
try
487
489
{
490
+ _logger . LogDebug ( "creating MutagenClient to stop orphan" ) ;
488
491
var client = new MutagenClient ( _mutagenDataDirectory ) ;
489
492
await client . Daemon . TerminateAsync ( new DaemonTerminateRequest ( ) , cancellationToken : ct ) ;
490
493
}
@@ -496,6 +499,10 @@ private async Task<MutagenClient> StartDaemon(CancellationToken ct)
496
499
{
497
500
// Mainline; no daemon running.
498
501
}
502
+ finally
503
+ {
504
+ _logger . LogDebug ( "finished with orphan mutagen client" ) ;
505
+ }
499
506
500
507
// If we get some failure while creating the log file or starting the process, we'll retry
501
508
// it up to 5 times x 100ms. Those issues should resolve themselves quickly if they are
@@ -528,6 +535,7 @@ private async Task<MutagenClient> StartDaemon(CancellationToken ct)
528
535
ct . ThrowIfCancellationRequested ( ) ;
529
536
try
530
537
{
538
+ _logger . LogDebug ( "creating mainline mutagen client" ) ;
531
539
var client = new MutagenClient ( _mutagenDataDirectory ) ;
532
540
_ = await client . Daemon . VersionAsync ( new VersionRequest ( ) , cancellationToken : ct ) ;
533
541
_mutagenClient = client ;
0 commit comments