Hi,
the knldiag entry show how the dead of a connection is detected. The SAPDB
kernel uses 'kill(0)' to check the process still exists. 

The connection via jdbc uses the x_server (vserver process) to communicate
with SAPDB. This is the process that must be killed to allow
SAPDB kernel to detect death of client. The communication between SAPDB
kernel and clients follows a pure ping-pong principle. Each request must
have an answer before the next request can be send. Unfortunately the
vserver process - while waiting for SAPDB answer - was blocking itself on a
semaphore. This did not allow him to watch the status of the socket at the
same time. I think i solved this problem in release 7.3.0b23 with an
deadCheck code that interrupts the semaphore call via an alarm timer and
this way polls the socket state all 10 seconds, while waiting for an answer
from SAPDB kernel. The 10 seconds are quiet a long time for SAPDB to answer,
so normal working connections are not influenced.

Meanwhile you can either stop the x_server (x_server stop) which
unfortunatly also kill all other client connections or try to find
the 'right' vserver. If you have a 7.3.0b21 or higher release, an x_cons
command 'show connection' was added, which allows to find the process id of
the vserver that was forked for the blocked task.

If you killed the process that owns DOMAIN.LOCKS the reply is send from the
kernel to the vserver and the vserver detects that the socket is already
dead, terminating itself so the task is freed later on, since the kernel is
now able to detect the no commonication partner exists for the task anymore.

CU
jrg

> -----Original Message-----
> From: Thomas Markus [mailto:[EMAIL PROTECTED]]
> Sent: Mittwoch, 29. Mai 2002 10:37
> To: sapdb.general
> Subject: problem with dead client & locks
> 
> 
> Hi,
> 
> I had following problem. I have a java servlet (webserver application
> with multiple connections & connection pooling), which 
> connects via jdbc.
> Sometimes one connection hangs (I have 3 entries in 
> DOMAIN.LOCKS for one
> session). Other connections trie also to lock (if I access 
> that tables)
> and hangs forever. I don't set a lock myself. I use default 
> transaction
> processing. If i stop all clients (shutdown webserver), the 
> connections
> (and the locks) are still existing (log appended). If I kill the first
> blocking process, all remaining tasks are freed. In knldiag I have
> entries like this
> 
> --------------------------------------------------------------
> -----------
> 2002-05-27 15:09:17 25952     11509 COMMUNIC Connection broken by appl
> state 10 T29
> 2002-05-27 15:09:17 25952 WNG 11824 COMMUNIC Releasing  T29 connection
> aborted
> 2002-05-27 15:09:17 25952     11007 COMMUNIC wait for connection T29
> --------------------------------------------------------------
> -----------
> 
> Why is the connection existent if the client is killed? How 
> can I avoid
> that problem?
> 
> thanks
> 
> Thomas
> 
> 
> OS is Linux (2.4.10-64GB-SMP), 2xCel466 @768MB
> 
> log from dbmcli
> --------------------------------------------------------------
> -----------
> server1:~ # /opt/sapdb/depend/bin/dbmcli -d PSAP -u dba,dba 
> show active
> OK
> 
> 
> SERVERDB: PSAP
> 
> ID UKT  UNIX  TASK       APPL  Current       Timeout   Region   Wait
> Dispatch
>            tid  type        pid  state        priority  cnt 
> try   time count
> T29  6  25952 User          0* Vwait               0    0  -1   1559
> 94854(s)
> T30  6  25952 User          0* Vwait               0    0  -1   1156
> 94854(s)
> T31  6  25952 User          0* Vwait               0    0  -1    953
> 94854(s)
> T32  6  25952 User          0* Vwait               0    0  -1   2172
> 94854(s)
> T33  6  25952 User          0* Vwait               0    0  -1    584
> 94854(s)
> T34  6  25952 User          0* Vwait               0    0  -1   1916
> 94854(s)
> T36  6  25952 User          0* Vwait               0    0  -1   2011
> 94854(s)
> T41  6  25952 User          0* Vwait               0    0  -1    499
> 94854(s)
> server1:~ # /opt/sapdb/depend/bin/dbmcli -d PSAP -u dba,dba 
> db_cons kill T29
> OK
> 
> 
> -- 
> Thomas Markus
> Tel: 030 29 36 399 - 18
> mailto:[EMAIL PROTECTED]
> Proventis GmbH
> Torellstr. 1
> 10243 Berlin
> 
> 
> 
> _______________________________________________
> sapdb.general mailing list
> [EMAIL PROTECTED]
> http://listserv.sap.com/mailman/listinfo/sapdb.general
> 
_______________________________________________
sapdb.general mailing list
[EMAIL PROTECTED]
http://listserv.sap.com/mailman/listinfo/sapdb.general

Reply via email to