Re: CLR Deadlock?

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance




"Feroze [msft]" <ferozed@xxxxxxxxxxxxxxxxxxxx> wrote in message
news:42bc6b46$1@xxxxxxxxxxxxxxxxxxxxx
> YOu will have to attach a debugger to the process to figure out what is
> going wrong. It could be a whole host of things, and debugging the process
> is the first step to getting a resolution on this.

I know, but the problem is that this is remote installation which I have
limited access to and also this is not easily reproducible in lab. I am also
aware of the fact that there are lot of things which could lead to such
behaviour and I'm not claiming there is bug in .NET framework, rather I just
wanted to check whether somebody has noticed such deadlock (obviously, track
this bug will consume lot of time and effort).

> Also, since you are not able to connect to the process using telnet, it
> could mean that the machine is out of ports. Can you do a "netstat -n -P
> TCP" to see what is the connection state on that machine?

I did netstat, I connected with VNC and networking was functioning OK (I
mapped drive also). Only thing I noticed it that there are multiple idle
connections on remoting port (checked with TCPView also, CONNECTED state).
There were no suspicious connections (eg. LAST_ACK, CLOSE_WAIT state etc.).
It seems that when you disable/enable network connection, remoting opens new
connection and old one is never released, I have yet to check this. We had
lot of problems with remoting as there is no timeout on TCP channel. Timeout
on remoting call through TCP channel would be nice - we had to move some
calls to new thread and abort the thread on timeout which is bad to do.

Anyway, I have added one thread that will just touch one file every few
minutes. That thread does not acquire any locks, so it should not deadlock.
If it continues to work after rest is locked, I'll guess classical deadlock
in the app. I plan to remove all calls to lock(...) with my own lock
mechanisam that will throw on timeout, which should at least prevent
deadlock. Pitty that lock keyword does not support this...

Regards,
Goran

> --
> feroze
>
> -----------------
> This posting is provided as-is. It offers no warranties and assigns no
> rights.
>
> See http://weblogs.asp.net/feroze_daud for System.Net related posts.
> ----------------
>
> "Goran Sliskovic" <gsliskov@xxxxxxxxx> wrote in message
> news:ega6Yw$dFHA.1136@xxxxxxxxxxxxxxxxxxxxxxx
> > Hi,
> > I am diagnosing a strange problem in .NET service (written in C#,
> > framework
> > 1.1 with sp1 installed - 1.1.4322.2032). Service is multhithreaded
> > (heavily)
> > and takes huge load (in CPU time, memory consumption and IO load).
Service
> > uses remoting to expose some interfaces and makes a lot of calls to
> > unmanaged C dlls.
> >
> > After some time, approx 10 days of real havy load (100% cpu usage almost
> > constant), service is totally locked. All threads hang. Memory
consumption
> > is OK, service process is there, yet there is no response. 0% processor
> > load, stops listening to remoting requests (telneting to remoting port
> > yields "connection refused" - service is not listening on the port
anymore
> > or cannot accept connection).
> >
> > I also log any unhandled exceptions (installed
> > UnhandledExceptionEventHandler), no exception thrown.
> >
> > I cannot rule out deadlock in my code, but as far as I checked, it is
> > unlikely that all threads can deadlock (there are some threads that
> > periodicly log system status that should not aquire locks).
> >
> > Any info is appreciated - has anybody noticed such strange things under
> > really heavy load?. Possibly GC blocked or similar (I would at least
like
> > to
> > rule out .NET bug). Number of allocation/deallocation is really heavy in
> > the
> > system. I have checked MSDN and see some problems with deadlock, all
> > claimed
> > to be solved with 1.1 sp1.
> >
> > Remoting is my best suspect for now, as there is no timeout on remoting
> > call
> > (TCP binary channel), which could potentially create such problems.
> >
> > Regards,
> > Goran
> >
>
>

.



Relevant Pages

  • Server not connected, or connection refused.
    ... I'm working on wiring up some remoting to my website, ... For one the server code ... So I have read that tcp has no timeout and using the http timeout ... property does no good for the connection itself (it always times out between ...
    (microsoft.public.dotnet.framework.remoting)
  • Re: Deadlock analysis
    ... Serializable means that if you are in a transaction and execute a SELECT ... this by getting a shared lock on a range of rows in the table. ... Now if another connection does ... It will now be blocked by the second connection and we have a deadlock. ...
    (microsoft.public.sqlserver.programming)
  • Re: Deadlock analysis
    ... You are using transaction isolation level "serializable". ... It does this by getting a shared lock on a range of rows in the table. ... Since 'Charles" is between 'Bill' and 'George', this connection will now have a shared lock on every value between 'Bill' and 'George'. ... Notice that this deadlock occurs even though one connection was only concerned with 'Charles' and the other only with 'David'. ...
    (microsoft.public.sqlserver.programming)
  • Re: Autorization header
    ... In the client's remoting config file, make sure you're specifying to send ... force the server to close the connection with the client for each request. ... > header but then subsequent headers does not contain the header. ... > the IIS server know what credentials are used for the subsequent requests ...
    (microsoft.public.dotnet.framework.remoting)
  • Re: Question from the ADO.NET Team
    ... The Connection would have to be Remoted. ... > Currently most classes in ADO.NET such connection, command, datareader, ... > parameters, etc. inherit from MarshalByValueComponent, MarshalByRefObject ... > use most of these through remoting directly) and it adds certain overhead ...
    (microsoft.public.dotnet.framework.adonet)