Troubleshooting IIS "Hang" / Postback Not Working

H

happyinst

I have recently added some code to a web application and now I find it
hanging after I do about 2 or 3 postbacks within the application. It hangs
after
doing different things (I cannot find anything in common) and when I run in
Debug mode, it doesn't even appear to be within my code when it hangs (I put
breakpoints all over the place and it doesn't stop at any of them during the
hang).

It hangs after I click a button on the page... but it never reaches the
Page_Load event of the page it is posting back to.. it is like the PostBack
isn't working.

How do I figure out what is going on? What really confuses me is the fact
that the code works the first time but not the second time I run it.. even
with the exact same input data...

It does seem to be related to uploading images... so I went through my code
and made sure I was disposing of all of the image objects in Finally
statements.

Any thoughts on how I can find the problem?

I have ANTS profiler by Red Gate software and I tried doing a memory profile
but it didn't seem to get me anywhere (either that or I wasn't doing it
right).

It is not causing IIS to crash... just to "spin" for a long time. This is
on my development Win XP Pro machine.

After quite some time, I get the following errors when I debug... but I
think they are more a symptom of the non-response to the application as
opposed to the cause of my problem.
----------------------------------
A first chance exception of type 'System.Net.Sockets.SocketException'
occurred in system.dll

Additional information: An existing connection was forcibly closed by the
remote host

A first chance exception of type 'System.IO.IOException' occurred in
system.dll

Additional information: Unable to read data from the transport connection.

Lori
 
S

Steven Cheng[MSFT]

Hi Lori ,

Welcome to ASP.NET newsgroup.
From your description, one of your asp.net always run into hanging after
you do some modification recently. I'm not quite sure what's your orginally
code logic and what's your modification on them. However, have you been
able to isolate the problem to a certain or some certain individule pages?

Also, based on your error message, I think you're doing some network
transfering task , using Socket or httpwebrequest? Generally, if your
server's CPU utilization is not high and application hangs, it's likely
that there are some thread deadlock in your app or there are some longrun
task in your page's exectution steps which block the server's workthreads.
Would provide some further description on your code logic?

In addition, I suggest you turn on the ASP.NET's trace and use Trace.Write
or Warn to output some trace info in the different stage of those page's
execution lifecycle. For example, before page_load and after Page_Load or
before a method call and after a method call. Then, we can use the
application's trace.axd to view which stage consumes most of the times.

If there are any further findings, please feel free to post here also. Good
Luck!

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
 
Joined
Oct 9, 2012
Messages
1
Reaction score
0
Database transaction not ended?

We had a similar issue. It turns out that on one postback a database transaction was started, then an error occurred but the db transaction was never rolled back. Then on the next postback, the transaction was still open, so when trying to touch the same table again in the db, it caused the web application to hang.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,733
Messages
2,569,440
Members
44,831
Latest member
HealthSmartketoReviews

Latest Threads

Top