You requested it

Got a good idea? You can suggest new features here.
Post Reply
User avatar
kgschlosser
Site Admin
Posts: 4178
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

You requested it

Post by kgschlosser » Wed May 16, 2018 8:18 am

You folks wanted it and I have made it. Coming soon is a Watchdog Timer plugin for EG. Keep your eyes on the Plugins section of the forum.

I still have a few things to finish up and there are some features i want to add to it. But here is the skinny on how it is going to work.

Things needed
  • You will need to be running a WIP version of EG. This version of EG has a newly designed named pipe system written in pure python. This implementation of the named pipe has some very large changes to overcome some limitations of the old system. It is going to allow the watchdog timer to function properly.
  • You will need to make sure your Windows User permissions allow for creation of symbolic links.
    This is only going to be needed for the firth time it is run. The reason why is a copy of py.exe from your EG installation needs to be made into the plugins folder. it is then going to be renamed to EventGhostWatchdog and a symbolic link is going to be made back to the EG installation lib27 folder. this is so the watchdog timer can run and have a process name you are going to be familiar with. This process only has to be done a single time so running EG as an Administrator then adding the plugin to your tree is the ideal way to go.
The watchdog timer is again another pure python Windows API connector for handling process creation, process termination, process locating, process memory counters, performance data and all of the named pipe connection bits.

in order to create the watchdog process we have to create a watchdog starter process that creates the watchdog process. this is a very screwy mechanism but it is the only way to not have the watchdog timer be the child of the EG process. When you kill the parent the child dies with it. But if you have the child make a grandchild and the child exits nice and clean the grandchild then becomes detached from the family so to speak. so you can then terminate the EventGhost process without the watchdog getting terminated along with it. (took me a while to get this bugger right)

The watchdog timer sends command to the Watchdog plugin via the use of the named pipe. When those commands get run they do several things. First off is it send configuration information to the watchdog executable. the second is it performs a series of tests. because EG has 3 core threads, the Main Thread, the Action Thread, and the Event Thread it is possible to have one of these threads get buggered up. So the watchdog timer runs a timed test against each one of them. if there is no result within the given time period the timer will make the call that something is buggered up and it will restart EG. If EG completely crashes without warning this will cause a new session of EG to be spawned.

There are currently 2 settings for the watchdog. how often it check to see if EG is working properly. and a restart event. the event will get triggered when EG gets restarted from a crash. I also want to add how long the timeout periods are for the thread checks and also how long of a stall period before restarting EG. The last item would be the maximum amount of time that is allowed to pass from when it asks the plugin to run it's tests to when the watchdog gets a reply. if the time elapses EG would be restarted. I also want to add a log file size cap. this is the number in which the file will be overwritten with new log data.

These metrics are captured and saved to a log file when there is an EG hang. they are captured from the hung process. May help to see what is causing an issue.

Performance Data
  • Commit Total
  • Commit Limit
  • Commit Peak
  • Physical Total
  • Physical Available
  • System Cache
  • Kernel Total
  • Kernel Paged
  • Kernel Nonpaged
  • Page Size
  • Handle Count
  • Process Count
  • Thread Count

Process Memory Counters
  • Page Fault Count
  • Peak Working Set Size
  • Working Set Size
  • Quota Peak Paged Pool Usage
  • Quota Paged Pool Usage
  • Quota Peak NonPaged Pool Usage',
  • Quota NonPaged Pool Usage
  • Pagefile Usage
  • Peak Pagefile Usage
  • Private Usage
It is in a raw form at the moment but it does function. and it functions well. I need to add those couple of things i mentioned above and then build a new version of EG with the named pipe modifications in place.

The plugin is sort of a test thing. if it works successfully then there is a very strong possibility of it being added to the core.
I am going to try to make the thing run as a service and have it's own GUI for setting options directly.
If you like the work I have been doing then feel free to Image

Post Reply