db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Knut Anders Hatlen (JIRA)" <derby-...@db.apache.org>
Subject [jira] Commented: (DERBY-1326) Network server may abandon sessions when Derby system is shutdown and this causes intermittent hangs in the client
Date Thu, 14 Sep 2006 17:58:23 GMT
    [ http://issues.apache.org/jira/browse/DERBY-1326?page=comments#action_12434752 ] 
            
Knut Anders Hatlen commented on DERBY-1326:
-------------------------------------------

Deepa wrote:

> * I think it is okay to re-use free/idle threads without closing
>   them. It may not be okay to re-use active threads without
>   closing/poisoning them. If we do this, wouldn't we end up with
>   threads getting invalid/closed sessions to work on?

Yes, that is correct. This is also the case with the current code. The
active threads remain alive until the client sends a new
command. Since the embedded connection is closed, it gets a
connection-closed exception and closes the session, before it
discovers that the thread is closed as well, and exits. If we don't
close the threads, we get the same behaviour, except that the thread
is reused instead of closed down after the connection-closed
exception.

> * Isn't this a possible scenario which can cause a hang in a client:
>   When restart is in progress, a new client session comes in and gets
>   added to runQueue. After the session is added, the restart code
>   closes the new session or clears the runQueue. So the server just
>   discards the new session and the client keeps waiting.

This is a possible scenario, but it won't cause a hang. Since the
session and its socket streams have been closed, the client will get
an IOException on read() (seen as DRDAProtocolException, for instance:
insufficient data, read -1 bytes, expected 6).

(But there is in fact a similar situation that can occur in the
current code, and that will cause a hang: If a new session is added to
runQueue after the restart code has closed all sessions in runQueue,
but before it has called runQueue.clear(), the new session will be
removed from runQueue without being closed, and the client will
hang. derby-1326-cleanup_exceptions.diff should fix that issue.)

> Network server may abandon sessions when Derby system is shutdown and this causes intermittent
hangs in the client
> ------------------------------------------------------------------------------------------------------------------
>
>                 Key: DERBY-1326
>                 URL: http://issues.apache.org/jira/browse/DERBY-1326
>             Project: Derby
>          Issue Type: Bug
>          Components: Network Server
>            Reporter: Deepa Remesh
>         Assigned To: Knut Anders Hatlen
>         Attachments: derby-1326-cleanup_exceptions.diff, repro1326.java, resolve_DRDConnThread_conflict.diff,
Restart.java, sessionMgmt1.diff, sessionMgmt1_and_nosessionsforclosedthreads.diff, unify_NSImpl_instances.diff,
withNewThreadAndNoShutdownOfCurrentSession.diff
>
>
> This issue was found when working on DERBY-1219. More details can be found in the comments
at http://issues.apache.org/jira/browse/DERBY-1219

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Mime
View raw message