cloudy cloudy

Author Topic: Preventing the opening of another utility when one utility is already running!  (Read 2122 times)

0 Members and 1 Guest are viewing this topic.

Offline R_o_B

  • Posts: 341
  • Maple Bay, British Columbia, Canada
  • OS/Browser:
  • Win NT 10.0
  • Firefox 52.0
    • Tzouhalem-Maple Bay Weather
Brian, twice this past week, Weather Display opened/started the same utility (such as 'cronairquality.exe', 'cronweatherflow.exe', 'ftpupd.exe', etc.) over and over
- on Tuesday, there were no less than 1000 of those utilities trying to run ... but the computer had run out of memory - I had to power off the computer;
- on Thursday, there were at least 100 of those utilities running - I was able to delete all of them before restarting the computer.
Is there a way for Weather Display to check if a utility is already running before starting another copy of that utility?

Note: Similar situations have happened in the past but not as bad as this past week - this is the first time that I encounter the same situation twice within a week, considering that I have not updated in the past weeks (running version 10.37S build 98).
R_o_B
---
eMail: weather@tzweather.org

Offline Weather Display

  • Posts: 87,244
  • Davis VP2
  • New Zealand
  • OS/Browser:
  • Win NT 10.0
  • Chrome 75.0.3770.142
    • Weather Display
it sounds like maybe your internet connection was down or similar and those programs got stuck and did not close
what I could do is run a check for is running and then if do a kill that program command

Offline R_o_B

  • Posts: 341
  • Maple Bay, British Columbia, Canada
  • OS/Browser:
  • Win NT 10.0
  • Firefox 52.0
    • Tzouhalem-Maple Bay Weather
Brian, I did not have problem with the Internet ... that I know  - none of my IoT devices (ie: Amazon Echo, Samsung SmartThings Hub, Philips Hue Bridge, Hubitat Elevation Hub, etc.) reported that they were disconnected from the Internet (their respective clouds).

What I noticed thought is that there have been some problems with PurpleAir, either the data was slow to download or did not download at all - indeed, there were a lot of 'cronairquality.exe' opened among the utilities.

Brian, that would be great - for Weather Display to check if the utility (or program) is already running (before starting another copy of that utility) and ensure that the currently running utility is completely killed/shut-down (may I suggest the following logical strategy:

- if the current utility cannot be killed/shut-down, display an onscreen error message about the utility (and possibly make an entry into one of the log files) and prevent that utility to start again - Weather Display should be able to continue its normal operations but without said utility;
- if the current utility can be killed/shut-down (and can be verified that it has indeed been killed/shut-down), then start a new copy of the utility (an entry into one of the log files might also be a good idea)

Thank you for looking into this...
R_o_B
---
eMail: weather@tzweather.org

Offline Weather Display

  • Posts: 87,244
  • Davis VP2
  • New Zealand
  • OS/Browser:
  • Win NT 10.0
  • Chrome 75.0.3770.142
    • Weather Display
lets start with a patch for the cronpurpleair ..

Offline R_o_B

  • Posts: 341
  • Maple Bay, British Columbia, Canada
  • OS/Browser:
  • Win NT 10.0
  • Firefox 52.0
    • Tzouhalem-Maple Bay Weather
lets start with a patch for the cronpurpleair ..
Whatever you say/write, boss...  :wink:
R_o_B
---
eMail: weather@tzweather.org

Offline Weather Display

  • Posts: 87,244
  • Davis VP2
  • New Zealand
  • OS/Browser:
  • Win NT 10.0
  • Chrome 75.0.3770.142
    • Weather Display
try
http://www.weather-display.com/downloadfiles/weatherdisplaytest.zip

every hour any cronairquality.exe process running will be killed off (hopefully)
as a test

Offline R_o_B

  • Posts: 341
  • Maple Bay, British Columbia, Canada
  • OS/Browser:
  • Win NT 10.0
  • Firefox 52.0
    • Tzouhalem-Maple Bay Weather
Test version of Weather Display installed at around 02:00 PST.

What should I check for, what signs am I looking for ... other than continuously staring at the screen for hours...  :sad11: :shocked!:
R_o_B
---
eMail: weather@tzweather.org

Offline R_o_B

  • Posts: 341
  • Maple Bay, British Columbia, Canada
  • OS/Browser:
  • Win NT 10.0
  • Firefox 52.0
    • Tzouhalem-Maple Bay Weather
Brian, had a the same problem (as mentioned above) earlier today.

Fortunately, when I looked at the screen, only 4 error windows were opened, 2 error windows from the 'ftpupd.exe' program and 2 error windows from the 'cronairquality2.exe' program.

To be on the safe side, I closed the 4 windows, exited WD and restarted the computer.
R_o_B
---
eMail: weather@tzweather.org

Offline Weather Display

  • Posts: 87,244
  • Davis VP2
  • New Zealand
  • OS/Browser:
  • Win NT 10.0
  • Chrome 75.0.3770.142
    • Weather Display
I can add the cronairquality2.exe

Offline R_o_B

  • Posts: 341
  • Maple Bay, British Columbia, Canada
  • OS/Browser:
  • Win NT 10.0
  • Firefox 52.0
    • Tzouhalem-Maple Bay Weather
Brian, when you write "I can add..." do you mean that you have to add code to each/every programs to check if a previous version of that program is already running?

I know, I know, I do not know anything about the code of WD, but, is it not (would it be) possible to add the 'is-it-already-running' code into WD just before WD calls (start running) the program?

Although there is (more likely/probably) no relationship between the code used to write WD and the code used to write PHP scripts ... with PHP, it is possible to add some code to check if a PHP script is already running and prevent a second copy of that PHP script to start.

But then again, I am just a beginner programmer...   :oops:
R_o_B
---
eMail: weather@tzweather.org

Offline Weather Display

  • Posts: 87,244
  • Davis VP2
  • New Zealand
  • OS/Browser:
  • Win NT 10.0
  • Chrome 75.0.3770.142
    • Weather Display
I do have some code to check what windows programs are running
which I could use
but that will not detect if that program is hung and needs to be killed off
anyway try another test update, same url as above

Offline R_o_B

  • Posts: 341
  • Maple Bay, British Columbia, Canada
  • OS/Browser:
  • Win NT 10.0
  • Firefox 52.0
    • Tzouhalem-Maple Bay Weather
but that will not detect if that program is hung and needs to be killed off
Brian, if the program has been started and for some reasons is hung, then, in my views, another copy of that program should not be started ... unless the program can be killed ... and a log entry should be done with the name of the hung program and if the hung program could be killed.

I know I seem to be asking for a lot ... but I am trying to make your WD as 'solid' and as reliable as possible.

New version downloaded - will be installed in the nest few hours.
R_o_B
---
eMail: weather@tzweather.org

Offline R_o_B

  • Posts: 341
  • Maple Bay, British Columbia, Canada
  • OS/Browser:
  • Win NT 10.0
  • Firefox 52.0
    • Tzouhalem-Maple Bay Weather
Well, it happened again earlier today!

There were (at least) 347 running programs: 'cronairquality2.exe', 'cronopenweathermap.exe', 'cronpws.exe', 'cronwindycom.exe', 'ftpupd.exe' were mostly all the programs continuously running and trying to open other versions of themselves until there was no memory left - this computer has been running without problem with 24.0GB of RAM memory for at least 5 years.

Is there anything I could check, anything I could test?

Note: I am running exactly the same weather-related programs (ie: Abyss Web Server, FWI, GRLevel3, IPTimelapse, Weather Display, and WXSIM) on another much less powerful computer (same setting for all the programs) without having all those 100s of programs 'eating up' all the RAM memory.
R_o_B
---
eMail: weather@tzweather.org

Offline Weather Display

  • Posts: 87,244
  • Davis VP2
  • New Zealand
  • OS/Browser:
  • Win NT 10.0
  • Chrome 76.0.3809.100
    • Weather Display
I am not sure why you are having this problem
i have not seen other reports of this happening and I have not had it happen here

I could try for a test to check if a program is running before starting a new version

Offline R_o_B

  • Posts: 341
  • Maple Bay, British Columbia, Canada
  • OS/Browser:
  • Win NT 10.0
  • Firefox 52.0
    • Tzouhalem-Maple Bay Weather
I could try for a test to check if a program is running before starting a new version
Indeed, this is basically what I have been hinting/suggesting since the beginning...

I do not know why one of the two computers running WD is having this problem ... the computer with the problems is the most 'powerful' computer (of the two weather computers ) running Windows 10 Pro version 1803 (not the latest update, but the last most reliable update) under an Intel Core i5-2500k @ 3.30 GHz CPU with 24GB RAM - the other computer (the one without problem) is also running Windows 10 Pro version 1803 under an Intel Pentium Dual Core E6600 @ 3.06 GHz CPU with 4GB RAM.
R_o_B
---
eMail: weather@tzweather.org

 

cumulus