WatchDirectory Forum
http://www.watchdirectory.net/cgi-bin/yabb25/YaBB.pl
watchDirectory forums >> Bug Reports >> Using BAT plugin, cpu uses 50% doing nothing
http://www.watchdirectory.net/cgi-bin/yabb25/YaBB.pl?num=1159867956

Message started by koalit on Oct 3rd, 2006 at 11:32am

Title: Using BAT plugin, cpu uses 50% doing nothing
Post by koalit on Oct 3rd, 2006 at 11:32am
Hi Gert.
Using WD pro 4.0.47 and the BAT plugin.
I find the server using 50% CPU on wdRun.exe - always 50% not 49 or 51. This stops the queue from monitoring any new actions.
Is it possible to make it "fail out" if nothing has happened for xx seconds/minutes ?

The WD Task is set to NOT capture output, but not to "Dont wait".

Thanks for any help, this is driving me crazy, it happens 2-3 times every week. (always at the most inconvenient time)

Best regards,
Mark Bjærgager
Koalit
cap_004.jpg (96 KB | )

Title: Re: Using BAT plugin, cpu uses 50% doing nothing
Post by Gert on Oct 3rd, 2006 at 6:26pm
Hi,

The 4.1 release on the beta forum may very well fix this issue.

Your version...
What is probably happening is that your .bat file is paused or blocked somewhere.
As the option "don't wait for .bat files to complete" is NOT checked by you, WD is waiting for the .bat to quit. The loop where it waits is checking the output of the .bat (even if you didn't select "capture output") and writes it to WD's window. When your .bat is blocked, WD will, in some bizar circumstances, run a very tight loop that will consume all cpu on the current processor (multi processor) or core (multi-core). Not sure how it would run on hyper-threading cpu's, but 50% seems logical.

4.1: when WD detects the strange situation, it will try 20 times (0.5 second interval) to see if the .bat writes anything. If it does WD continues to wait for it (and reset the "20 counter" to zero). If after 20 attempts (10 seconds) there is still no output from the .bat, WD will give up waiting, and the next event will be processed.

Gert

WatchDirectory Forum » Powered by YaBB 2.5.2!
YaBB Forum Software © 2000-2017. All Rights Reserved.