geronimo-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Donald Woods (JIRA)" <>
Subject [jira] Closed: (GERONIMODEVTOOLS-178) Deadlock! while stopping Geronimo server from within Eclipse
Date Fri, 27 Jul 2007 14:55:18 GMT


Donald Woods closed GERONIMODEVTOOLS-178.

       Resolution: Fixed
    Fix Version/s: 2.0

Committed revision 560256.  Thanks for the patch.

> Deadlock! while stopping Geronimo server from within Eclipse
> ------------------------------------------------------------
>                 Key: GERONIMODEVTOOLS-178
>                 URL:
>             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
>             Fix For: 2.0
>         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. (
> 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
> Please see this also:
> 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.

View raw message