-q failing to close properly?

For technical support for all editions of CSE HTML Validator. Includes bug reports.

-q failing to close properly?

Postby jscar » Tue Jun 22, 2010 10:09 am

If am calling Batch Wizard via a script using cmdlineprocessor.
If htmlvalidator is not already open the -q switch doesn't close it but if it is already open and I run the script again it closes at the end of the script.

In the status bar of htmlvalidator I can see a message saying quit signal received in the second instance but not the first.

Any ideas why the quit signal is not being picked up in the first instance?
jscar
Rank II - Novice
Rank II - Novice
 
Posts: 47
Joined: Mon Jul 16, 2007 3:12 am

Re: -q failing to close properly?

Postby Albert Wiersch » Tue Jun 22, 2010 1:30 pm

Hello,

Sorry, CSE HTML Validator was designed to only assume there is one instance running, so it only sends one instance the quit signal. I will try to look into this further for a future release to see if all instances can be sent the quit signal. How important is this to you? Thank you.
Image
Albert Wiersch
User avatar
Albert Wiersch
Site Admin
Site Admin
 
Posts: 2435
Joined: Sat Dec 11, 2004 10:23 am
Location: Near Dallas, TX

Re: -q failing to close properly?

Postby jscar » Wed Jun 23, 2010 2:27 am

Hi Albert
That doesn't explain why the -q parameter doesn't close the first instance though. Does it? Am I missing something? Possibly haven't explained the problem very well. To reiterate:

[batch wizard is closed to start with]
script opens batch wizard with cmdlineprocessor.exe -b <listname>
[batch wizard opens and runs the list file and pops up the html report]
script closes batch wizard with cmdlineprocessor.exe -q
[batch wizard remains open]
script opens batch wizard with cmdlineprocessor.exe -b <newlistname>
[batch wizard runs the list file and show 'quit signal received' and pops up the html report]
script closes batch wizard with cmdlineprocessor.exe -q
[batch wizard closes]

Hope that clarifies.

Julian



I plan to run batch wizard nightly via scheduled scripts. In the current version HTMLValidator will be open for 24 hours every 48hour period (if I've got my maths right). I don't know what implicaitons that will have for the resources of the server on which it's running.
jscar
Rank II - Novice
Rank II - Novice
 
Posts: 47
Joined: Mon Jul 16, 2007 3:12 am

Re: -q failing to close properly?

Postby Albert Wiersch » Wed Jun 23, 2010 4:02 pm

Hi Julian,

Sorry, I misunderstood.

The "-q" should cause CSE HTML Validator (which includes the Batch Wizard) to close. The command should not return until the job completes and the program exits out of memory.

From the documentation for cmdlineprocessor.exe -q:
If HTML Validator's editor is running, then this command sends a signal that causes it to exit. NOTE: Unsaved changes to documents, the configuration file, and the Batch Wizard target list will be lost if HTML Validator is closed in this manner. If the Batch Wizard is processing a target list, then HTML Validator will attempt to exit after the processing is complete. cmdlineprocessor.exe will return (exit) and the command will complete when HTML Validator's editor is closed.

So, because cmdlineprocessor.exe -q should not exit until CSE HTML Validator is closed, then your script should not start another instance until then. Could your script not be waiting for cmdlineprocessor.exe -q to complete before it runs the next command?

If cmdlineprocessor.exe -q exits/returns before CSE HTML Validator and the Batch Wizard stop running, then it is a bug. Please let me know if you think this is the case and I will look into it further.
Image
Albert Wiersch
User avatar
Albert Wiersch
Site Admin
Site Admin
 
Posts: 2435
Joined: Sat Dec 11, 2004 10:23 am
Location: Near Dallas, TX

Re: -q failing to close properly?

Postby jscar » Thu Jun 24, 2010 2:01 am

Hi Albert

I'm really sorry, I'm sending you the wrong message again. The script instances are separate (with each one being manually started at the moment). The sequence should read:
[batch wizard is closed to start with]
script is run
script opens batch wizard with cmdlineprocessor.exe -b <listname>
[batch wizard opens and runs the list file and pops up the html report]
script closes batch wizard with cmdlineprocessor.exe -q
[batch wizard remains open]
end of script
New script is run
script opens batch wizard with cmdlineprocessor.exe -b <newlistname or in testing samefilename>
[batch wizard runs the list file and show 'quit signal received' and pops up the html report]
script closes batch wizard with cmdlineprocessor.exe -q
[batch wizard closes]
end of script


Does that clarify things? It seems that the -q signal is not closing the first instance of html validator. Is it possible that the fisrt instance is not being closed because the job is not completing (even though the html report is being shown) and hence the program is not exiting out of memory?
jscar
Rank II - Novice
Rank II - Novice
 
Posts: 47
Joined: Mon Jul 16, 2007 3:12 am

Re: -q failing to close properly?

Postby Albert Wiersch » Thu Jun 24, 2010 8:31 am

jscar wrote:Does that clarify things? It seems that the -q signal is not closing the first instance of html validator. Is it possible that the fisrt instance is not being closed because the job is not completing (even though the html report is being shown) and hence the program is not exiting out of memory?


Is the first instance indicating that a quit signal was received?

If the job isn't completing, then I don't understand how the report is being shown? Is that what is happening? The job should compete before CSE HTML Validator exits and cmdlineprocessor.exe -q completes/returns. Also, the report should not show until the job completes.

What version are you using?

Can you post the exact (or almost exact) scripts that you are using?

Also, I wonder if it could be a timing issue. Can you insert a 5 second delay before cmdlineprocessor.exe -q and see if that has any effect, perhaps using something like "timeout /t 5" or "ping -n 5 htmlvalidator.com" to delay execution of cmdlineprocessor.exe -q.
Image
Albert Wiersch
User avatar
Albert Wiersch
Site Admin
Site Admin
 
Posts: 2435
Joined: Sat Dec 11, 2004 10:23 am
Location: Near Dallas, TX

Re: -q failing to close properly?

Postby jscar » Fri Jun 25, 2010 3:11 am

Also, I wonder if it could be a timing issue. Can you insert a 5 second delay before cmdlineprocessor.exe -q and see if that has any effect, perhaps using something like "timeout /t 5" or "ping -n 5 htmlvalidator.com" to delay execution of cmdlineprocessor.exe -q.


Seems like it was! :D Thanks for the heads-up
With wscript.sleep(5000) ( 5 sec delay ) just before the call to the -q command the batchwizard and htmlvalidator windows both close as expected.

Why would that work?
(v9.0302 Pro by the way.)
jscar
Rank II - Novice
Rank II - Novice
 
Posts: 47
Joined: Mon Jul 16, 2007 3:12 am

Re: -q failing to close properly?

Postby Albert Wiersch » Fri Jun 25, 2010 8:51 am

jscar wrote:Seems like it was! :D Thanks for the heads-up
With wscript.sleep(5000) ( 5 sec delay ) just before the call to the -q command the batchwizard and htmlvalidator windows both close as expected.

Why would that work?
(v9.0302 Pro by the way.)


Good... glad that was it! I will see if I can improve this for v10.00 - have it wait 5 seconds or so if it thinks CSE HTML Validator isn't running.

I suspect that it tried to send the quit signal before CSE HTML Validator was started/initialized to a point where it would work, thus it didn't send the quit signal. Waiting a bit gives CSE HTML Validator more time to start.
Image
Albert Wiersch
User avatar
Albert Wiersch
Site Admin
Site Admin
 
Posts: 2435
Joined: Sat Dec 11, 2004 10:23 am
Location: Near Dallas, TX

Re: -q failing to close properly?

Postby Albert Wiersch » Fri Jun 25, 2010 11:49 am

Here's an update... I was able to add this to the upcoming release version...

In the release version, it will now wait up to ten seconds looking for an instance to send the quit signal to.

From the documentation for the quit command:
In v10.00 and later, if no instance of the editor is found, then this command will wait up to 10 seconds looking for an instance to send the quit signal to (this solves some possible timing issues).

I hope this addition will make the wait that one may have to add to scripts unnecessary for them to work correctly.
Image
Albert Wiersch
User avatar
Albert Wiersch
Site Admin
Site Admin
 
Posts: 2435
Joined: Sat Dec 11, 2004 10:23 am
Location: Near Dallas, TX


Return to CSE Tech Support

Who is online

Users browsing this forum: Google [Bot] and 2 guests