You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The service does not check if it's already running before starting up. Every-time you run the executable, it starts a new instance of the service.
Not sure how impactful this issue is. Could impact troubleshooting as the OS won't be able to write to the file while the service is still running.
The text was updated successfully, but these errors were encountered:
@mkdbns just to provide some info, after discussions with @asatkinson we decided this is not needed for the initial release but, I wanted the issue documented somewhere other than a Mattermost channel :)
I tried to explore and fix this issue and I was able to fix it using a named mutex. A named mutex can be owned by only one thread at a time. So, when the application starts for the first time, it is granted ownership of the mutex and I added checks that if the ownership of the mutex is not granted, that means another process is running so the current process will be closed. This logic fixed the issue but it raised another issue.
If we close the first process using Task manager, the process is killed suddenly without giving the chance to run any cleanup code. So, when the process is killed, the mutex isn't released and its ownership is still assigned to the process. Due to this reason, when we start the application again, it doesn't start because of not being able to get ownership of the mutex.
I explored to see how we can run cleanup code when a process is killed using Task manager, but unfortunately, there's no way to do that. When a process is killed using Task manager, it doesn't send any events or signals to the app. So, this app needs a better way of closing/exiting.
One method to do this is creating a secondary app that monitors this application and shows a system tray icon that the application is running. When the user exits the application using the system tray icon, then we can run the cleanup code.
The service does not check if it's already running before starting up. Every-time you run the executable, it starts a new instance of the service.
Not sure how impactful this issue is. Could impact troubleshooting as the OS won't be able to write to the file while the service is still running.
The text was updated successfully, but these errors were encountered: