openziti / desktop-edge-win

Provides a Ziti client for Windows
Apache License 2.0
35 stars 13 forks source link

timeout when stopping ziti service appears to prevent further attempts to stop the service #674

Closed dovholuknf closed 5 days ago

dovholuknf commented 1 month ago

It seems that when trying to stop the ziti "data" service from the UI, if the stopping of the service fails due to timeout, it leaves something "stuck", causing user confusion. The UI doesn't seem to work, feedback doesn't work, it appears to be hung up for reasons unknown.

Extend the timeout duration from 30 seconds to 60s or discover why the timeout appears to put the system into a state where it no longer appears to function.

from ZitiUpdateService.log:

[2024-05-23T13:02:23.789Z] DEBUG    ZitiDesktopEdge.Server.IPCServer    message received: {"Action":"Normal","Op":"Stop"}   
[2024-05-23T13:02:23.789Z] DEBUG    ZitiDesktopEdge.Server.IPCServer    Op: Stop    
[2024-05-23T13:02:23.789Z]  INFO    ZitiDesktopEdge.Server.ServiceActions   request to stop ziti service received... processing...  
[2024-05-23T13:02:53.875Z] ERROR    ZitiDesktopEdge.Server.IPCServer    Unexpected error in processMessage! System.ServiceProcess.TimeoutException: Time out has expired and the operation has not been completed.
   at System.ServiceProcess.ServiceController.WaitForStatus(ServiceControllerStatus desiredStatus, TimeSpan timeout)
   at ZitiDesktopEdge.Server.ServiceActions.StopService()
dovholuknf commented 1 month ago

This appears to be related to stopping ziti on a laptop disconnected from power, thus throttling the performance and exceeding the timeout. It seems that the easiest prevention mechanism is to make sure your laptop is plugged in when stopping ziti. The easiest resolution to this issue is to just restart the laptop. If that's not possible, as admin issue:

net stop ziti-monitor
net stop ziti
net start ziti-monitor
net start ziti

If this issue persists or if the commands don't work, please leave a comment. Particularly if you have steps to reproduce the issue.