Return-Path: Delivered-To: apmail-db-derby-dev-archive@www.apache.org Received: (qmail 64387 invoked from network); 26 May 2006 15:47:16 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 26 May 2006 15:47:16 -0000 Received: (qmail 8758 invoked by uid 500); 26 May 2006 15:47:16 -0000 Delivered-To: apmail-db-derby-dev-archive@db.apache.org Received: (qmail 8730 invoked by uid 500); 26 May 2006 15:47:15 -0000 Mailing-List: contact derby-dev-help@db.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: Delivered-To: mailing list derby-dev@db.apache.org Received: (qmail 8721 invoked by uid 99); 26 May 2006 15:47:15 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 26 May 2006 08:47:15 -0700 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received: from [209.237.227.198] (HELO brutus.apache.org) (209.237.227.198) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 26 May 2006 08:47:14 -0700 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 20D6C7142EB for ; Fri, 26 May 2006 15:46:31 +0000 (GMT) Message-ID: <28759548.1148658391131.JavaMail.jira@brutus> Date: Fri, 26 May 2006 15:46:31 +0000 (GMT+00:00) From: "Bryan Pendleton (JIRA)" To: derby-dev@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 In-Reply-To: <9452366.1147714146274.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N [ http://issues.apache.org/jira/browse/DERBY-1326?page=comments#action_12413488 ] Bryan Pendleton commented on DERBY-1326: ---------------------------------------- Hi Deepa, thanks very much for looking at the patch! The new message that you see is definitely a result of this patch; I see it as well, and should have mentioned it when I attached the patch. I believe that the new symptom is a result of the code I added to DRDAConnThread's run() method, to try to handle the case when a thread returns from getNextSession() to find itself in the interesting situation of having been given a Session to run, but also having been closed(): if (closed()) + { + // FIXME -- I think that if we return from + // getNextSession() with a non-null Session, but + // we ourselves have been closed(), this indicates + // a bug in the Network Server session management, + // as it shouldn't have assigned a valid session + // to a closed thread. Closing the session here + // is rude, but at least it prevents a hard hang. (DERBY-1326) + try { + if (session != null) + session.close(); + }catch (Exception e) { e.printStackTrace(); } break; + } It's clear that this code is wrong, as evidenced by the symptoms you see. Note also that in my code I didn't know what to do if I hit an exception; this is very closely related to bug DERBY-1020 (thanks Kathey for pointing this out). The question I have is (and this is the main question left in this bug, I think): what should the DRDAConnThread do in this situation? The possibilities I've thought of include: - ignore that fact that we've been closed; re-open ourselves and handle the Session we've been given - give the Session back to the NetworkServerControlImpl and ask it to assign a different thread to this task - hard-close the Session, then exit the thread. This was the solution I tried, and as you can see it has some awkard side-effects. Either of the first two seems like it might be a reasonable approach in the case where the Network Server was restarted, not shut down, but they both seem wrong in the case where the Network Server was shut down; in that case it seems that the Session is doomed and we should just pack our bags and leave quietly. Please let me know what you think about how best to handle this case. > 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 > Type: Bug > Components: Network Server > Reporter: Deepa Remesh > Assignee: Bryan Pendleton > Attachments: repro1326.java, sessionMgmt1.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