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

Commita17c915

Browse files
committed
chore: add debug logging to mutagen stop daemon
1 parent153ceb3 commita17c915

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
@@ -578,6 +578,7 @@ private void StartDaemonProcess()
578578
/// </summary>
579579
privateasyncTaskStopDaemon(CancellationTokenct)
580580
{
581+
_logger.LogDebug("stopping mutagen daemon");
581582
varprocess=_daemonProcess;
582583
varclient=_mutagenClient;
583584
varwriter=_logWriter;
@@ -590,28 +591,34 @@ private async Task StopDaemon(CancellationToken ct)
590591
if(client==null)
591592
{
592593
if(process==null)return;
594+
_logger.LogDebug("no client; killing daemon process");
593595
process.Kill(true);
594596
}
595597
else
596598
{
597599
try
598600
{
601+
_logger.LogDebug("sending DaemonTerminateRequest");
599602
awaitclient.Daemon.TerminateAsync(newDaemonTerminateRequest(),cancellationToken:ct);
600603
}
601-
catch
604+
catch(Exceptione)
602605
{
606+
_logger.LogError(e,"failed to gracefully terminate agent");
603607
if(process==null)return;
608+
_logger.LogDebug("killing daemon process after failed graceful termination");
604609
process.Kill(true);
605610
}
606611
}
607612

608613
if(process==null)return;
609614
varcts=CancellationTokenSource.CreateLinkedTokenSource(ct);
610615
cts.CancelAfter(TimeSpan.FromSeconds(5));
616+
_logger.LogDebug("waiting for process to exit");
611617
awaitprocess.WaitForExitAsync(cts.Token);
612618
}
613619
finally
614620
{
621+
_logger.LogDebug("cleaning up daemon process objects");
615622
client?.Dispose();
616623
process?.Dispose();
617624
writer?.Dispose();

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp