Indeed the problem was in the error handler (not foxweb, the custom error template). In the custom template a database file that I log error information to had become corrupted. In order to code for this I will have to create a standalone exe on the server that checks the integrity of the files used in the error template and alerts/repairs them automatically.
In revisiting the custom error template I was wondering how to get at the "memory variables" dump seen in the foxweb control panel tab (without accessing the log itself of course). I can capture the Server vars and query str etc using the proper methods but I did not see one for the memvars (not the session vars). How does the internal foxweb error handler accomplish this?
Sent by FoxWeb Support on 09/30/2014 12:58:54 PM:
It will be just as if you were running a regular VFP program inside a VFP process. Any dialogs will remain visible, waiting for input and blocking script execution. This is usually the reason why channels hang and are killed.
Note that such issues are not normally logged into the error log, because they don't cause an error, but rather pop a dialog, waiting for user input. The FoxWeb Channel Controller forcibly kills channels that are unresponsive for a period longer than the FoxWeb Script Timeout, so no errors are logged.
The FoxWeb error handler is extremely robust and never causes problems.
FoxWeb Support Team
Sent by Steve Moore on 09/30/2014 12:52:02 PM:
Already checked that and most of the time that would generate an error in the error log. Whatever is happening doesn't generate an error. Maybe the error handler itself is hanging? hmmm....
Back to my question: Would any dialogs remain until the window is closed or would I have to be watching the entire time? I'm assuming that if auto-restart is disabled that any dialogs that caused a hang would remain visible until I manually kill the window/channel?
Sent by FoxWeb Support on 09/30/2014 11:40:38 AM:
There can be many reasons for intermittent hangs. For example, it's possible that a FoxWeb script (or interactive instance of VFP) locks a data file, preventing other scripts from writing to it, or even opening it up for reading.
FoxWeb Support Team
Sent by Steve Moore on 09/30/2014 11:36:54 AM:
Some of the scripts are rather large and complex so adding additional logging code would be time consuming and troublesome.
FW_ENTER records the script call and query. FW_EXIT also adds to the record log. When there is no FW_EXIT in the record I can identify which calls are hanging. They correspond to the time and channel kill in the FW log. But calling the same script/query from a browser does not reproduce the hang.
If there were offending lines of
code then wouldn't calling the script that hung with the same query hang
the channel again?
I like your second suggestion better. However, the server receives hundreds of thousands of requests a day and the hangs are intermittent sometimes only showing up once in a few hours, sometimes in batches. Would any dialogs remain until the window is closed or would I have to be watching the entire time?
Sent by FoxWeb Support on 09/30/2014 11:12:02 AM:
One possibility would be to add more logging code inside the scripts that have been causing problems. This would allow you to isolate the offending lines of code.
Another possibility (but this one would require that you babysit your server) is to disable the "Run as a service", "Hide windows" and "Restart channels" options. After restarting FoxWeb, you will notice that you will have separate windows for each channel and that when a channel hangs, it will remain in place. Arrange and size the channel windows so that they are all visible on the screen at the same time and observe the server. With luck, you may see a dialog box pausing script execution and giving you hints on what is going on. Be very careful with leaving the "Restart channels" option disabled, because you will eventually run out of responsive channels.
FoxWeb Support Team
Sent by Steve Moore on 09/30/2014 11:01:32 AM:
I'm trying to track down some problems involving random channel kills. I am getting intermittent channel hangs with no error messages present. In order to try to track down the problem I inserted code in FW_ENTER and FW_EXIT tracking each call to Foxweb. Upon entry I log the calling script and query string as well as IP address, foxweb channel, agent and a few other items. Upon exit (FE_EXIT) I log the elapsed time and so on. By looking at the log I can see which script calls do not ever execute FW_EXIT.
The problem is that when I then execute the script called with the given query string there are no hangs. So I cannot reproduce the problem. Most of these scripts have been running for 10 years or longer. They do not contain any illegal commands, etc. The Fox Web start log is not much help.
I tried adjusting buffer memory and a few other random tweaks to no avail.
Can you suggest any other methods to try to pin down what is causing the channel hangs? It's not a critical problem in that the channels do restart but I would like to know what is causing the problem.