Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit5aed2d4

Browse files
committed
chore: add debug logging to mutagen stop daemon
1 parentee4ad9a commit5aed2d4

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

‎App/Services/MutagenController.cs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -575,6 +575,7 @@ private void StartDaemonProcess()
575575
/// </summary>
576576
privateasyncTaskStopDaemon(CancellationTokenct)
577577
{
578+
_logger.LogDebug("stopping mutagen daemon");
578579
varprocess=_daemonProcess;
579580
varclient=_mutagenClient;
580581
varwriter=_logWriter;
@@ -587,28 +588,34 @@ private async Task StopDaemon(CancellationToken ct)
587588
if(client==null)
588589
{
589590
if(process==null)return;
591+
_logger.LogDebug("no client; killing daemon process");
590592
process.Kill(true);
591593
}
592594
else
593595
{
594596
try
595597
{
598+
_logger.LogDebug("sending DaemonTerminateRequest");
596599
awaitclient.Daemon.TerminateAsync(newDaemonTerminateRequest(),cancellationToken:ct);
597600
}
598-
catch
601+
catch(Exceptione)
599602
{
603+
_logger.LogError(e,"failed to gracefully terminate agent");
600604
if(process==null)return;
605+
_logger.LogDebug("killing daemon process after failed graceful termination");
601606
process.Kill(true);
602607
}
603608
}
604609

605610
if(process==null)return;
606611
varcts=CancellationTokenSource.CreateLinkedTokenSource(ct);
607612
cts.CancelAfter(TimeSpan.FromSeconds(5));
613+
_logger.LogDebug("waiting for process to exit");
608614
awaitprocess.WaitForExitAsync(cts.Token);
609615
}
610616
finally
611617
{
618+
_logger.LogDebug("cleaning up daemon process objects");
612619
client?.Dispose();
613620
process?.Dispose();
614621
writer?.Dispose();

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp