bug with command line "eventghost.exe -e"

Found a bug in EventGhost? Report it here.
User avatar
kgschlosser
Site Admin
Posts: 4248
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: bug with command line "eventghost.exe -e"

Post by kgschlosser » Fri Dec 01, 2017 5:31 pm

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.
If you like the work I have been doing then feel free to Image

User avatar
kgschlosser
Site Admin
Posts: 4248
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: bug with command line "eventghost.exe -e"

Post by kgschlosser » Fri Dec 01, 2017 5:33 pm

Oh i forgot. if you want to give the new file a shot. it is attached.
Attachments
NamedPipe.py
(10.02 KiB) Downloaded 34 times
If you like the work I have been doing then feel free to Image

Snowbird
Experienced User
Posts: 349
Joined: Fri Jul 03, 2009 10:04 am

Re: bug with command line "eventghost.exe -e"

Post by Snowbird » Fri Dec 01, 2017 5:36 pm

ok, i replaced it, i'll let you know when I see something odd.

User avatar
kgschlosser
Site Admin
Posts: 4248
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: bug with command line "eventghost.exe -e"

Post by kgschlosser » Fri Dec 01, 2017 7:04 pm

I'm at 561 events generated so far.
If you like the work I have been doing then feel free to Image

Snowbird
Experienced User
Posts: 349
Joined: Fri Jul 03, 2009 10:04 am

Re: bug with command line "eventghost.exe -e"

Post by Snowbird » Fri Dec 01, 2017 7:14 pm

everything looks good so far on my end as well, let's wait a couple of hours.

User avatar
kgschlosser
Site Admin
Posts: 4248
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: bug with command line "eventghost.exe -e"

Post by kgschlosser » Sat Dec 02, 2017 9:41 am

I'm at 5900 events so far without error.
If you like the work I have been doing then feel free to Image

User avatar
kgschlosser
Site Admin
Posts: 4248
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: bug with command line "eventghost.exe -e"

Post by kgschlosser » Sat Dec 02, 2017 9:53 pm

10202
If you like the work I have been doing then feel free to Image

Snowbird
Experienced User
Posts: 349
Joined: Fri Jul 03, 2009 10:04 am

Re: bug with command line "eventghost.exe -e"

Post by Snowbird » Sun Dec 03, 2017 12:00 am

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 ! ;)

User avatar
kgschlosser
Site Admin
Posts: 4248
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: bug with command line "eventghost.exe -e"

Post by kgschlosser » Sun Dec 03, 2017 5:56 am

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.
If you like the work I have been doing then feel free to Image

Snowbird
Experienced User
Posts: 349
Joined: Fri Jul 03, 2009 10:04 am

Re: bug with command line "eventghost.exe -e"

Post by Snowbird » Sun Dec 03, 2017 5:18 pm

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 ! :)

User avatar
kgschlosser
Site Admin
Posts: 4248
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: bug with command line "eventghost.exe -e"

Post by kgschlosser » Sun Dec 03, 2017 5:31 pm

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
If you like the work I have been doing then feel free to Image

User avatar
kgschlosser
Site Admin
Posts: 4248
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: bug with command line "eventghost.exe -e"

Post by kgschlosser » Sun Dec 03, 2017 5:38 pm

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 41 times
If you like the work I have been doing then feel free to Image

Snowbird
Experienced User
Posts: 349
Joined: Fri Jul 03, 2009 10:04 am

Re: bug with command line "eventghost.exe -e"

Post by Snowbird » Sun Dec 03, 2017 6:46 pm

ok, new file is in place, let's wait and see now :)
I'll let you know if something goes wrong.

User avatar
kgschlosser
Site Admin
Posts: 4248
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: bug with command line "eventghost.exe -e"

Post by kgschlosser » Mon Dec 04, 2017 2:01 am

@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.
If you like the work I have been doing then feel free to Image

Snowbird
Experienced User
Posts: 349
Joined: Fri Jul 03, 2009 10:04 am

Re: bug with command line "eventghost.exe -e"

Post by Snowbird » Mon Dec 04, 2017 8:05 am

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 ! :wink:

Post Reply