Active VFP Hang Issue

Topics: Developer Forum
Nov 9, 2009 at 10:29 PM

We have a web application that has been developed using Active VFP v2.  We are running the application on Windows 2003 server and we are experiencing some issues with the application hanging.  We have setup a separate app pool for the application in IIS but the app is haning on a regular basis, sometimes once a day.  We have to recycle the app pool or terminate the process in order to get the site back up.  We have been running the site since February and this has only started occuring in the last 4 weeks.

We have run IIS debug diag on the server to watch for hangs.  This is picking up when the app is hanging and showing multiple threads, some of which appear to be open for some hours.  The debug report is advising that the pool has grown to its maximum size, and that some threads do not appear to have activity bound to them.  It is showing that the COM+ STA has a max of 50 threads with 50 threads running and only 1 activity per thread.

The app itself is reasonably sound and we do not get any errors.  In addition that hang appears to occur in various sections of the app randomly so not pointing to any code.

Any help that you can offer in troubleshooting the hang would be appreciated.

Kind regards,

Nick Alsop
Carousel Logistics Ltd

Coordinator
Nov 9, 2009 at 11:47 PM

A few more questions:

what version of VFP?

Is this happening with heavy load, medium, light or any kind of load?

Did it happen before you set up a separate app pool?

Something must not be right and we need to find a way to narrow the reasons for that down..

Nov 10, 2009 at 1:11 AM

Thank you for coming back to me.

We are using vfp7. Happens with med-heavy load. Error ocurred before we created the app pool - we did this to reduce impact on the server.

Error has inc in frequency from 1-2 week to almost daily. Load has increased though.

Any ideas on how we can start to track it down?

Many thanks,

Nick

----- Original Message -----
From: claudefox <notifications@codeplex.com>
To: Nick Alsop
Sent: Mon Nov 09 23:47:52 2009
Subject: Re: Active VFP Hang Issue [activevfp:74590]

From: claudefox

A few more questions:

what version of VFP?

Is this happening with heavy load, medium, light or any kind of load?

Did it happen before you set up a separate app pool?

Something must not be right and we need to find a way to narrow the reasons for that down..

Read the full discussion online <http://activevfp.codeplex.com/Thread/View.aspx?ThreadId=74590&ANCHOR#Post255276> .

To add a post to this discussion, reply to this email (activevfp@discussions.codeplex.com <mailto:activevfp@discussions.codeplex.com?subject=[activevfp:74590]> )

To start a new discussion for this project, email activevfp@discussions.codeplex.com

You are receiving this email because you subscribed to this discussion on CodePlex. You can unsubscribe <http://www.codeplex.com/site/discussions/thread/unsubscribe/74590> on codePlex.com.

Please note: Images and attachments will be removed from emails. Any posts to this discussion will also be available online at codeplex.com

Coordinator
Nov 10, 2009 at 12:44 PM
Edited Nov 10, 2009 at 12:52 PM

Some basics: You might want to experiment limiting memory usage within the application with SYS(3050, 1, VAL(SYS(3050, 1, 0)) / 3) since vfp will try to grab as much memory as possible.  Also, for any processor intensive loops you'll want to put a Sleep(0) in there.  Also extremely important is COMRETURNERROR in the the error handler - is it in there?  Not using COMRETURNERROR is really the only times I've seen an AVFP application hang...

I'm assuming you have the latest service pack for VFP7? Are you really on version 2 of AVFP??  It shouldn't be terribly difficult to go to v4.1.  And do you have VFP9? Might be worth experimenting if it's something we can't put our finger on.  Also, SQL Server backend or DBFs??

Here's another general article I found for troubleshooting: http://blogs.msdn.com/tess/archive/2006/10/16/net-hang-debugging-walkthrough.aspx

 

 

Nov 10, 2009 at 12:56 PM

Dear Claude,

Thank you for your help and speedy response.  We will look into the memory allocation, sleep and COMRETURNERROR asap.  As the app is running live we may have to wait until this evening (UK time) to make any core amendments.

We are using VFP7 and we are using v2 of AVFP.  We do have VFP v9 and we will look to move to AVFP 4.1.  We have several applications running on our server in v2.  Is there any issue in running v4.1 along side v2.  I assume that this should not really be a problem?  We would look to upgrade this app to v4.1 and then move the others gradually.

I will let you know what progress we make in due course.

Kind regards,

Nick

From: claudefox [mailto:notifications@codeplex.com]
Sent: 10 November 2009 12:44
To: Nick Alsop
Subject: Re: Active VFP Hang Issue [activevfp:74590]

From: claudefox

Some basics: You might want to experiment limiting memory usage within the application with SYS(3050, 1, VAL(SYS(3050, 1, 0)) / 3) since vfp will try to grab as much memory as possible. Also, for any processor intensive loops you'll want to put a Sleep(0) in there. Also extremely important is COMRETURNERROR in the the error handler - is it in there? Not using COMRETURNERROR is really the only times I've seen an AVFP application hang...

I'm assuming you have the latest service pack for VFP7? Are you really on version 2 of AVFP?? It shouldn't be terribly difficult to go to v4.1. And do you have VFP9? Might be worth experimenting if it's something we can't put our finger on.

Here's another general article I found for troubleshooting: http://blogs.msdn.com/tess/archive/2006/10/16/net-hang-debugging-walkthrough.aspx

Read the full discussion online.

To add a post to this discussion, reply to this email (activevfp@discussions.codeplex.com)

To start a new discussion for this project, email activevfp@discussions.codeplex.com

You are receiving this email because you subscribed to this discussion on CodePlex. You can unsubscribe on codePlex.com.

Please note: Images and attachments will be removed from emails. Any posts to this discussion will also be available online at codeplex.com

Coordinator
Nov 10, 2009 at 1:10 PM
Edited Nov 10, 2009 at 1:11 PM

I don't anticipate there being any problem running them side by side.  Of course the ideal would be to have a testing server where you can do all this experimentation without affecting the live app.

The core difference between 4.1 and the earlier versions is that main.prg is an external file (marked external in the activevfp project) and is therefore freely exchangeable without any locking issues (very much like the .NET ability to do the same with asp.net DLLs).  So, in effect, all of your application (html and prgs) is outside one central mtdll which is the activevfp.dll.

So, in your case, you'd have your v2 mtdll (whatever you named it) and the new centralized activevfp.dll so I don't think that should pose any problems..

Nov 10, 2009 at 2:27 PM

Hi Claude,

We do have a testing server which we can deploy to and we would look to release v4 into the test server before releasing into the live environment.  I wanted to check with you on running v2/v4 so that I could plan the extent of a migration as we have multiple apps running on the server.

We have checked the memory limitations.  There are no memory limits in the app except for the HTTPupload which is never called in this particular application.  We will test putting a memory limit on the application in general.

We are using the standard default error handler in AVFP v2 which does use COMRETURNERROR when the app is launched in the startmode 2,3,5.  We are receiving errors correctly if we have any bad code.

We are using IIS Debug Diag which is firing when we get an error.  The attached log is from the last hang.

Kind regards,

Nick

From: claudefox [mailto:notifications@codeplex.com]
Sent: 10 November 2009 13:10
To: Nick Alsop
Subject: Re: Active VFP Hang Issue [activevfp:74590]

From: claudefox

I don't anticipate there being any problem running them side by side. Of course the ideal would be to have a testing server where you can do all this experimentation without affecting the live app.

The core difference between 4.1 and the earlier versions is that main.prg is an external file (marked external in the activevfp project) and is therefore freely exchangeable without any locking issues (very much like the .NET ability to do the same with asp.net DLLs). So, in effect, all of your application is outside one central mtdll which is the activevfp.dll.

So, in your case, you'd have your v2 mtdll (whatever you named it) and the new centralized activevfp.dll so I don't think that should pose any problems..

Read the full discussion online.

To add a post to this discussion, reply to this email (activevfp@discussions.codeplex.com)

To start a new discussion for this project, email activevfp@discussions.codeplex.com

You are receiving this email because you subscribed to this discussion on CodePlex. You can unsubscribe on codePlex.com.

Please note: Images and attachments will be removed from emails. Any posts to this discussion will also be available online at codeplex.com

Nov 11, 2009 at 5:45 PM

Hi Claude,

We have been working on the issue over the last few days.  We have limited the memory usage.  We also access a remote database within the application and we have added code to ensure that the database is fully closed down within the application.  After applying these changes the app has been running smoothly.  Hopefully this will clear up the issues.

Thank you for your assistance.  We will let you know if anything further develops.

Kind regards,

Nick

From: claudefox [mailto:notifications@codeplex.com]
Sent: 10 November 2009 13:10
To: Nick Alsop
Subject: Re: Active VFP Hang Issue [activevfp:74590]

From: claudefox

I don't anticipate there being any problem running them side by side. Of course the ideal would be to have a testing server where you can do all this experimentation without affecting the live app.

The core difference between 4.1 and the earlier versions is that main.prg is an external file (marked external in the activevfp project) and is therefore freely exchangeable without any locking issues (very much like the .NET ability to do the same with asp.net DLLs). So, in effect, all of your application is outside one central mtdll which is the activevfp.dll.

So, in your case, you'd have your v2 mtdll (whatever you named it) and the new centralized activevfp.dll so I don't think that should pose any problems..

Read the full discussion online.

To add a post to this discussion, reply to this email (activevfp@discussions.codeplex.com)

To start a new discussion for this project, email activevfp@discussions.codeplex.com

You are receiving this email because you subscribed to this discussion on CodePlex. You can unsubscribe on codePlex.com.

Please note: Images and attachments will be removed from emails. Any posts to this discussion will also be available online at codeplex.com