Welcome! Log In Create A New Profile

Advanced

[WD27] 64 bit Service hangs randomly

Posted by Michael Drechsel 
[WD27] 64 bit Service hangs randomly
May 02, 2023 01:29PM
Hi,

I have build a 64 bit service at a windows server 2012 r2.

Most of the time it does nothing. It runs every 10 seconds and check some values.

Unfortunately it hangs after 1 or 2 days. A restart of the service fails, I have to kill the process before.

I tried everythink without luck. And I have no idea how to debug the issue.

Any ideas ?

regards Michael
Re: [WD27] 64 bit Service hangs randomly
May 02, 2023 04:05PM
Hi Michael,

is it a memory leak?? Which version of WINDEV?

Kind regards,
Guenter Predl
office@windev.at
JP
Re: [WD27] 64 bit Service hangs randomly
May 02, 2023 04:14PM
If possible could you write a simple log file (text file) of the key steps in the service program. At each key step, update the log with the step name, date, and time. And possibly other info like memory etc. This will then show you exactly where the service is hanging up, i.e. what the last thing it could do was done. I use logs that write both the before-action-entry and an after-action entry so I can be sure which action was started but not completed.
Re: [WD27] 64 bit Service hangs randomly
May 02, 2023 04:47PM
JP Wrote:
-------------------------------------------------------
> If possible could you write a simple log file
> (text file) of the key steps in the service
> program. At each key step, update the log with the
> step name, date, and time. And possibly other info
> like memory etc. This will then show you exactly
> where the service is hanging up, i.e. what the
> last thing it could do was done. I use logs that
> write both the before-action-entry and an
> after-action entry so I can be sure which action
> was started but not completed.

Yes, that was indeed my next idea. I found a way to activate a logging without change the program:

I found this in the help:

Activation without modifying the application, via a specific fileTo do so, create a file named <Executable Name>.WX beside the executable of the application. This file must contain the following lines:

[LOG]
Active=<0/1>
File=<Name of the log file>
Option=<Value of options>


Has anybody experience with that ? I can´t get it to work, no file has created.

regards Michael
Re: [WD27] 64 bit Service hangs randomly
May 02, 2023 04:48PM
Hi Guenter,

its WD27, no memory leak.

regards Michael
Re: [WD27] 64 bit Service hangs randomly
May 05, 2023 10:27AM
hi,

i've been struggling for weeks with a similar problem, WD26/27/28 seems to lose connection to mysql after 1-2 days of service work, i had to add everywhere on error EndService(esFailure)
so the service can be restarted automatically using the windows features.
Does anyone have experience with a service that works seamlessly with an attached database?
Re: [WD27] 64 bit Service hangs randomly
May 05, 2023 10:56AM
Hi marcov,

did you inform PC Soft Free Tech Support? If so, what did they say?

Kind regards,
Guenter Predl
office@windev.at
Re: [WD27] 64 bit Service hangs randomly
May 07, 2023 04:48PM
marcov Wrote:
-------------------------------------------------------

> works seamlessly with an attached database?

Yes.

It´s a funfact. I have another service (also WD27) running at the same machine which works perfect without any issues 24*7.

I don´t know what the problem is.

Meanwhile I found out (with my little logfile) that it hangs (when it hangs) always at the same point, after a

hreadfirst (myfile).

It runs 2 days and then ***bang**** it crashes. Memory consumption ~1,2 MB. No errors, no execeptions.

regards Michael
Al
Re: [WD27] 64 bit Service hangs randomly
May 07, 2023 05:14PM
Hello Michael,

Is it time to try crazy options like a periodic HClose(myfile) and/or HCloseConnection() and then re-open the file or connection.
The refresh may work or if they fail, you might get an actual error message.

Regards
Al
Re: [WD27] 64 bit Service hangs randomly
May 07, 2023 10:47PM
Hi AI,

hCloseconnection I already used and I put HClose() in the code.

PLz cross the fingers that it works.

thx

regards Michael
Re: [WD27] 64 bit Service hangs randomly
May 08, 2023 06:49AM
Hi Michael, random errors out of nowhere, just my ... lots of our customers are bakeries and they have big refrigerators for their goods, air conditioners, deep freezers and so on. Whenever such a machine starts, it sends a short series of spikes into the mains and into their computers. I don't leave house anymore for those rather frequent complaints, I just recommend buying a UPS (= USV) for connecting the computer. Regularily, those errors are gone with this cure.

Kind regards,
Guenter Predl
office@windev.at
Re: [WD27] 64 bit Service hangs randomly
May 08, 2023 02:00PM
HI Guenther,

its a virtual machine in a cluster of 3 hosts, with all UPS and so on.

regards Michael
Re: [WD27] 64 bit Service hangs randomly
May 16, 2023 02:49PM
I had something similar and even though I made sure I cleaned up memory it would still hang after a while. So I put in code to let it shutdown after 12 hours and configured the scheduler to restart it soon after that.

Since then, for anything that has to be run at 5-minute intervals or more, I use the scheduler. Your case can be a combination.

issah
Re: [WD27] 64 bit Service hangs randomly
May 17, 2023 11:24AM
OK, I solved it. In one of my functions I used Error() , I Looks Like the Service stops then.

regards Michael
Author:

Your Email:


Subject:


Spam prevention:
Please, enter the code that you see below in the input field. This is for blocking bots that try to post this form automatically. If the code is hard to read, then just try to guess it right. If you enter the wrong code, a new image is created and you get another chance to enter it right.
Message: