bug with command line "eventghost.exe -e"
- kgschlosser
- Site Admin
- Posts: 4428
- Joined: Fri Jun 05, 2015 5:43 am
- Location: Rocky Mountains, Colorado USA
Re: bug with command line "eventghost.exe -e"
ok so I have a test running. it is going to create 10000000 events. one every 10 seconds. lets see if i can get this thing to error. I moved the sleep to a different spot. I am hoping that it works in the new location.
- kgschlosser
- Site Admin
- Posts: 4428
- Joined: Fri Jun 05, 2015 5:43 am
- Location: Rocky Mountains, Colorado USA
Re: bug with command line "eventghost.exe -e"
Oh i forgot. if you want to give the new file a shot. it is attached.
- Attachments
-
- NamedPipe.py
- (10.02 KiB) Downloaded 37 times
Re: bug with command line "eventghost.exe -e"
ok, i replaced it, i'll let you know when I see something odd.
- kgschlosser
- Site Admin
- Posts: 4428
- Joined: Fri Jun 05, 2015 5:43 am
- Location: Rocky Mountains, Colorado USA
Re: bug with command line "eventghost.exe -e"
I'm at 561 events generated so far.
Re: bug with command line "eventghost.exe -e"
everything looks good so far on my end as well, let's wait a couple of hours.
- kgschlosser
- Site Admin
- Posts: 4428
- Joined: Fri Jun 05, 2015 5:43 am
- Location: Rocky Mountains, Colorado USA
Re: bug with command line "eventghost.exe -e"
I'm at 5900 events so far without error.
- kgschlosser
- Site Admin
- Posts: 4428
- Joined: Fri Jun 05, 2015 5:43 am
- Location: Rocky Mountains, Colorado USA
Re: bug with command line "eventghost.exe -e"
Everything is ok on my end, I think the problem is solved for good, it never worked for so long before your fix. So can you explain to me what you have done exactly, I just want to try to understand. Are you going to insert this fix in the next EG release, or will I have to add this file manually every time ?
Thank you !
Thank you !

- kgschlosser
- Site Admin
- Posts: 4428
- Joined: Fri Jun 05, 2015 5:43 am
- Location: Rocky Mountains, Colorado USA
Re: bug with command line "eventghost.exe -e"
Its a wee bit complex in the detailed explanation. I will try to give you the short and sweet version.
There are several thing that are happening with the named pipe. all that a named pipe really is, is a file and like all files only one program can write to it at a time. The already running version of EventGhost is what makes this file. once the file is made then it sits there reading it in a never ending loop. once something gets written to the file then it gets read and processed and any return information gets written back to the file. once that information has been read. then file gets destroyed and a new one made. for the next connection. So one of the mechanisms we do to check is to send that ping and see if we get a pong back. if there is no pong then there is no EG that is running.
in the time it takes for the first instance to recreate the file after that pong has been sent the new instance is already connecting to a file that does not exist. and this causes a loop. because the first instance is trying to make the file at the exact same time the second is messing around with it. so they both end up in synchronized loop. so by adding the sleep interval if an error occurs but only on one side will make it so that this crazy thing doesn't happen again. But to make 100% sure i am going to use a random number generator to spit out the sleep time. which will be something between 1 millisecond and 100 milliseconds. so in the off chance it starts to happen again the sleep time changing on the second attempt will destabilize the loop.
and yes this will 100% be in the next version of EG.
There are several thing that are happening with the named pipe. all that a named pipe really is, is a file and like all files only one program can write to it at a time. The already running version of EventGhost is what makes this file. once the file is made then it sits there reading it in a never ending loop. once something gets written to the file then it gets read and processed and any return information gets written back to the file. once that information has been read. then file gets destroyed and a new one made. for the next connection. So one of the mechanisms we do to check is to send that ping and see if we get a pong back. if there is no pong then there is no EG that is running.
in the time it takes for the first instance to recreate the file after that pong has been sent the new instance is already connecting to a file that does not exist. and this causes a loop. because the first instance is trying to make the file at the exact same time the second is messing around with it. so they both end up in synchronized loop. so by adding the sleep interval if an error occurs but only on one side will make it so that this crazy thing doesn't happen again. But to make 100% sure i am going to use a random number generator to spit out the sleep time. which will be something between 1 millisecond and 100 milliseconds. so in the off chance it starts to happen again the sleep time changing on the second attempt will destabilize the loop.
and yes this will 100% be in the next version of EG.
Re: bug with command line "eventghost.exe -e"
ok, thank you for this clear explanation I understand a bit better now.
I have a bad news though, I just got the odd behavior again, I have two instances of EG are running at the same time... It took a long time to happen but it happened. Regarding the previous error I have reported in my screenshot, it didn't occurred at all since your fix, so we're halfway there !
I have a bad news though, I just got the odd behavior again, I have two instances of EG are running at the same time... It took a long time to happen but it happened. Regarding the previous error I have reported in my screenshot, it didn't occurred at all since your fix, so we're halfway there !

- kgschlosser
- Site Admin
- Posts: 4428
- Joined: Fri Jun 05, 2015 5:43 am
- Location: Rocky Mountains, Colorado USA
Re: bug with command line "eventghost.exe -e"
I am going to use threading.wait instead of time.sleep. I am hoping this will function better. I will also put in that random time generation. so give me a few minutes to key that up
- kgschlosser
- Site Admin
- Posts: 4428
- Joined: Fri Jun 05, 2015 5:43 am
- Location: Rocky Mountains, Colorado USA
Re: bug with command line "eventghost.exe -e"
ok I have confirmed this does not cause the 2nd process issue. I am hoping this is going to solve the synchronization problem. I have this also set up to randomly set the waiting period. anywhere from 1 to 100 milliseconds.
- Attachments
-
- NamedPipe.py
- (10.1 KiB) Downloaded 47 times
Re: bug with command line "eventghost.exe -e"
ok, new file is in place, let's wait and see now 
I'll let you know if something goes wrong.

I'll let you know if something goes wrong.
- kgschlosser
- Site Admin
- Posts: 4428
- Joined: Fri Jun 05, 2015 5:43 am
- Location: Rocky Mountains, Colorado USA
Re: bug with command line "eventghost.exe -e"
@Snowbird
Thanks for the testing of this. it's a huge help. it's one of those kinds of bugs. I am unable to replicate, But i can see where there is an issue. How to specifically repair it could take some time if this attempt does not work out.
Thanks for the testing of this. it's a huge help. it's one of those kinds of bugs. I am unable to replicate, But i can see where there is an issue. How to specifically repair it could take some time if this attempt does not work out.
Re: bug with command line "eventghost.exe -e"
no problem, that's the least I can do when I see all the hard work you put into EG everyday... you're the one to be thanked ! 
