Live multi-user debugging? Help!

  • Thread starter Thread starter Tom wilson
  • Start date Start date
T

Tom wilson

I have an asp.net app running off of a W2003 server. It's being
written in VS2003. I've encountered a problem where a database record
is being updated with the wrong value intermittently. So I debug the
page.

I step through the code and the value Session("PersonID") changes
right before my eyes for no apprent reason. Now, this is where it
gets really weird. I'm attached to the process on the web server and
debugging. I give up and close the web browser. Fine.

I'm yakking away to a co-worker about the problem the nsuddenly out of
nowhere, VS stops at a breakpoint. ??? I closed the browser and
haven't clicked on anything. So I examine the personID. It's 2259.
Not the one I was working with. So I hit continue. A moment later,
it stops at the same breakpoint by itself and the personID is now
3278. Continue. Moments later...

It's picking up live people using the site! How can I debug this
application if live people are constantly changing the state of the
debugging session? This is why it's writing the wrong values, the
session values seem to be changing at will based on who's logged into
the site.

Umm.. help? :) Is this by design? Is it an internal problem with the
web server or VS or....

Any help much appreciated, thanks!
 
Tom said:
I have an asp.net app running off of a W2003 server. It's being
written in VS2003. I've encountered a problem where a database record
is being updated with the wrong value intermittently. So I debug the
page.

I step through the code and the value Session("PersonID") changes
right before my eyes for no apprent reason.

That's a symptom of having "maximum number of worker processes" for an
application pool being more than 1. To have more than 1, you have to use
out-of-process session state storage. Useful search keyword: aspnet_state.

Andrew
 
Yes, that sounds like it. But I'm having much trouble finding any
information on it. Searches for aspnet_state return hundreds of pages
telling me what it does (from the 'is it a worm?' aspect). I searched
for "Maximum number of worker processes". Google returns 3 hits.
There's an excellent page out there that tells me how to change the
values but not WHAT I should chnage those values to. Like:

"DWORD value set to the number of requests after which a new worker
process will be launched to take the place of the current one. The
default is infinite, a keyword indicating that the process should not
be restarted. "

Do I change this? What do I change it to? What about the other
values? Do I change those and to what?

Does anyone know of any intelligible information on the topic?

Thanks for the reply!
 
Tom said:
Yes, that sounds like it. But I'm having much trouble finding any
information on it. Searches for aspnet_state return hundreds of pages
telling me what it does (from the 'is it a worm?' aspect). I searched
for "Maximum number of worker processes". Google returns 3 hits.
There's an excellent page out there that tells me how to change the
values but not WHAT I should chnage those values to. Like:
Do I change this? What do I change it to? What about the other
values? Do I change those and to what?

/Do/ you have "Maximum number of worker processes" set to more than one? You
might get answers from people more knowledgable in this are than me (not
difficult) in microsoft.public.inetserver.iis, but here's what I think the
settings do:
-------------------------
Recycling:-
Recycle worker processes: tear it down and start again just in case it's
gone messy somewhere. IME, in-process session-state gets destroyed when it
recycles a worker process.

Memory recycling: well, if it comes to that, either add more RAM or find the
memory leak. (Talking about memory, if the site seems sluggish, have a look
under the performance tab in Task Manager. If the total commit charge is
greater than the total physical memory then it wants more RAM.)


Performance:-
Idle timeout: shut it down after a while so that the next request after that
takes longer as it has to wake up again. This might also interfere with
session state (if so, look out for the session state timeout for the web
site - the setting you get to by right-clicking the web site, then
Properties->Home Directory tab->Configuration...->Options tab).


Request queue limit: reduce DOS attack effect.
CPU monitoring: what to do if it goes mad for too long.

Web garden: if one worker process gets stuck (see Recycling above), you can
have another one going so that people can still use the web site. Of course,
I should have put timeouts around all my requests to other services so it
didn't get stuck in the first place..


Health:-
Dunno, but if it ain't broke, don't fix it.


Identity:-
You might want to run the service under a different account from the
default, like you do with SQL Server etc. I've never tried that.
----------------------------

This article tells it all w.r.t. session state:-
http://msdn2.microsoft.com/en-us/library/ms178586.aspx

Oh - no it doesn't. It doesn't mention that with out-of-process
session-state you must make sure that everything you store in a Session()
variable must be <Serializable()> as in
<Serializable()> Public Class basketCentral
Implements IDisposable ' keeps it happy
......

And another thing: before wiggling all the bits, manually back up the config
by right-clicking on the computer in IIS Manager and going through All
Tasks..., and then back it up again when you've got it working
satisfactorily. If you have to re-install IIS, only the manually backed up
configs survive.

HTH

Andrew
 
Tom said:
I'm yakking away to a co-worker about the problem the nsuddenly out of
nowhere, VS stops at a breakpoint. ??? I closed the browser and
haven't clicked on anything. So I examine the personID. It's 2259.
Not the one I was working with. So I hit continue. A moment later,
it stops at the same breakpoint by itself and the personID is now
3278. Continue. Moments later...

Sounds to me like a Threading issue, with VS stopping on the breakpoints
in your code as each /executing Thread/ passes through them.
It's picking up live people using the site!

"Fun", isn't it?
How can I debug this application if live people are constantly
changing the state of the debugging session?

And, IMHO, this is just one reason why I would never recommend trying to
"Debug" a live application /even if/ you have some way of limiting
access to only those individuals that need to be in there at any point
in time!

However, wouldn't each Client be accessing their /own/ Session data?
Certainly if there's /any/ possibility of one person seeing data held in
another person's Session information then I, for one, will /not/ be
moving to ASP.Net /any/ time soon.
This is why it's writing the wrong values, the session values seem
to be changing at will based on who's logged into the site.

Well, /if/ we're talking about the Session object, that would be the
case, wouldn't it?

HTH,
Phill W.
 
Thanks, I'm building a new web server for these domains so I'll apply
thisi n the new construction.
 
Weird, the application in question hosts 2 events. The first event
involves about 50 people and works flawlessly. The second event
involves over 2500 people and there are errors throughout the
database. Same code, same site. I'm setting up a new production
server and a seperate development server and I'll keep this in mind.

Thanks!
 
Back
Top