Hi

For about 5 years I've had a 'roll my own' logfile function running in an Active4D application.

The logfile entry 'buffer' gets populated in the Active4D 'On Request' event handler and the actual entry is written in the http request handler ('On Web Connection').

Lately, some error has been occuring after about 24 hours of up time and hanging the server (at least the logfile writing part of it - the application still has a responsive user interface). I don't know what the error is yet - will find out shortly hopefully - but I was wondering in general in these cases if its better to:

[1] - open the logfile in 'On Startup' and keep it open throughout the running of the web server (so that 'On Web Connection' only has to do SEND PACKET)

[2] - open and close the logfile at every single write (i.e. call Append Document --> SEND PACKET --> CLOSE DOCUMENT every time)

At the moment I'm doing [1].

Another thing: Instead of using a 4D local semaphore to protect this process, I've been using a 4D global boolean variable. (This is bad because the boolean variable is not bullet proof - in fact I should even be using a semaphore to set the global variable).

However, in tests, I've been able to call SEND PACKET from 400 process at once without any flag protection at all and have no problems. I thinking that something else is the problem. What would cause 4D to have a problem writing to a file suddenly after thousands of writes ? I don't think it's a virus checker - again I ran the virus checker on the specific log file of half a gigabyte while the 400 processes were writing SEND PACKETS to it unprotected by any semaphore and it was fine.

If anyone has experience of different approaches in this department I'd appreciate their input while I try to solve it long term. At the moment we're having to restart the web server every day or so based on texts alerts from the auto 'up time' monitor.

Regards

Peter
_______________________________________________
Active4D-dev mailing list
[email protected]
http://mailman.aparajitaworld.com/mailman/listinfo/active4d-dev
Archives: http://mailman.aparajitaworld.com/archive/active4d-dev/

Reply via email to