Return-Path: Delivered-To: apmail-geronimo-dev-archive@www.apache.org Received: (qmail 78975 invoked from network); 27 Jul 2007 13:55:50 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 27 Jul 2007 13:55:50 -0000 Received: (qmail 66975 invoked by uid 500); 27 Jul 2007 13:55:47 -0000 Delivered-To: apmail-geronimo-dev-archive@geronimo.apache.org Received: (qmail 66930 invoked by uid 500); 27 Jul 2007 13:55:47 -0000 Mailing-List: contact dev-help@geronimo.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: Reply-To: dev@geronimo.apache.org List-Id: Delivered-To: mailing list dev@geronimo.apache.org Received: (qmail 66901 invoked by uid 99); 27 Jul 2007 13:55:46 -0000 Received: from Unknown (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 27 Jul 2007 06:55:46 -0700 X-ASF-Spam-Status: No, hits=-100.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO brutus.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 27 Jul 2007 13:55:38 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 53CBC71403E for ; Fri, 27 Jul 2007 06:55:18 -0700 (PDT) Message-ID: <953624.1185544518329.JavaMail.jira@brutus> Date: Fri, 27 Jul 2007 06:55:18 -0700 (PDT) From: "Donald Woods (JIRA)" To: dev@geronimo.apache.org Subject: [jira] Assigned: (GERONIMODEVTOOLS-178) Deadlock! while stopping Geronimo server from within Eclipse In-Reply-To: <3472452.1185530898633.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 [ https://issues.apache.org/jira/browse/GERONIMODEVTOOLS-178?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Donald Woods reassigned GERONIMODEVTOOLS-178: --------------------------------------------- Assignee: Donald Woods > Deadlock! while stopping Geronimo server from within Eclipse > ------------------------------------------------------------ > > Key: GERONIMODEVTOOLS-178 > URL: https://issues.apache.org/jira/browse/GERONIMODEVTOOLS-178 > Project: Geronimo-Devtools > Issue Type: Bug > Components: eclipse-plugin > Affects Versions: 1.2.0, 1.2.1, 2.0 > Reporter: Shiva Kumar H R > Assignee: Donald Woods > Attachments: deadlockFix.patch, TestDeadlock.war > > > An interesting deadlock scenario! > Here are the steps to reproduce: > 1. From within Eclipse start Geronimo server (say 2.0) > 2. Deploy attached WAR > 3. Access deployed servlet with url "http://localhost:8080/TestDeadlock/Test" > 4. From within Eclipse invoke "Stop" server > You will see that Stop never returns and Eclipse freezes to respond. > 5. Manually kill server process and Eclipse will resume. > Here is what is happening: > 1. When user invokes "Stop" on Geronimo server from within Eclipse, Geronimo Eclipse Plug-in invokes stopKernel() in the main Eclipse thread itself. (org.apache.geronimo.st.core.GeronimoServerBehaviourDelegate.java::stop()) > 2. Server receives the shutdown call, and invokes the deployed WAR's "servlet.destroy" method, which in turn opens a big text file and starts printing the contents to standard output. > 3. All the output buffers overflow because the main thread is the one that should push them to the console view at the end but it is blocked. > 4. All the print operations on the server side are blocked waiting for somebody to read the output buffer. The shutdown call will never return. > 5. The main Eclipse thread will never print the messages because it waits for the shutdown call to return. > Here is one solution thought of: > The Geronimo Eclipse plug-in should make the shutdown call in a worker thread not in the main Eclipse thread. In this case the main thread will be able to display all the messages triggered by the shutdown call and everything will work just fine. Attached patch implements this. > Please see this also: > http://www.eclipse.org/webtools/wst/api/org/eclipse/wst/server/core/model/ServerBehaviourDelegate.html#stop(boolean) > It recommends that the plug-in should return from the "ServerBehaviourDelegate.stop()" method quickly and use the server listener to notify shutdown progress. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.