You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@felix.apache.org by "Patrick Forhan (JIRA)" <ji...@apache.org> on 2008/09/24 16:42:44 UTC

[jira] Created: (FELIX-734) Remote shell bundle can prevent felix shutdown

Remote shell bundle can prevent felix shutdown
----------------------------------------------

                 Key: FELIX-734
                 URL: https://issues.apache.org/jira/browse/FELIX-734
             Project: Felix
          Issue Type: Bug
          Components: Remote Shell
    Affects Versions: shell.remote-1.0.2
         Environment: felix 1.2.0, shell-remote 1.0.2
            Reporter: Patrick Forhan


One one of our PCs, issuing a shutdown command to felix remote shell would hang indefinitely.  We could go to the console window and still type in commands to the local shell, and a 'ps' showed that bundle 0 and the remote-shell bundle were in "stopping" states.

The problem was in remote.shell's Listener.java.  The deactivate method seemed to be expecting the m_ServerSocket.close() call on line 70 to cause an exception in the waiting thread at line 104, the  m_ServerSocket.accept() call.

For most of our machines, this seems to work as expected.  But the one that did waited forever for the thread join to happen, and could never shutdown.

To address this, we set the serverSocket's SOTimeout field, so that it it will timeout, go through the do/while loop, and reevaluate the m_stop variable.  The timeout is configurable via the bundle context property "osgi.shell.telnet.SocketTimeout" and defaults to 0, the current behavior.

Patch will be attached shortly.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (FELIX-734) Remote shell bundle can prevent felix shutdown

Posted by "Felix Meschberger (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/FELIX-734?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12634773#action_12634773 ] 

Felix Meschberger commented on FELIX-734:
-----------------------------------------

Thanks for the supplied patch. I will look into applying it shortly.

Can you please tell me the Java runtime version and vendor as well as possibly the OS platform you used, where you encountered the issue. Thanks.

> Remote shell bundle can prevent felix shutdown
> ----------------------------------------------
>
>                 Key: FELIX-734
>                 URL: https://issues.apache.org/jira/browse/FELIX-734
>             Project: Felix
>          Issue Type: Bug
>          Components: Remote Shell
>    Affects Versions: shell.remote-1.0.2
>         Environment: felix 1.2.1, shell-remote 1.0.2
>            Reporter: Patrick Forhan
>         Attachments: RemoteShellListenerPatch.txt
>
>
> On one of our PCs, issuing a shutdown command to felix remote shell would hang indefinitely.  We could go to the console window and still type in commands to the local shell, and a 'ps' showed that bundle 0 and the remote-shell bundle were in "stopping" states.
> The problem was in remote.shell's Listener.java.  The deactivate method seemed to be expecting the m_ServerSocket.close() call on line 70 to cause an exception in the waiting thread at line 104, the  m_ServerSocket.accept() call.
> For most of our machines, this seems to work as expected.  But the one that did waited forever for the thread join to happen, and could never shutdown.
> To address this, we set the serverSocket's SOTimeout field, so that it it will timeout, go through the do/while loop, and reevaluate the m_stop variable.  The timeout is configurable via the bundle context property "osgi.shell.telnet.SocketTimeout" and defaults to 0, the current behavior.
> Patch will be attached shortly.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (FELIX-734) Remote shell bundle can prevent felix shutdown

Posted by "Patrick Forhan (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/FELIX-734?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Patrick Forhan updated FELIX-734:
---------------------------------

    Description: 
On one of our PCs, issuing a shutdown command to felix remote shell would hang indefinitely.  We could go to the console window and still type in commands to the local shell, and a 'ps' showed that bundle 0 and the remote-shell bundle were in "stopping" states.

The problem was in remote.shell's Listener.java.  The deactivate method seemed to be expecting the m_ServerSocket.close() call on line 70 to cause an exception in the waiting thread at line 104, the  m_ServerSocket.accept() call.

For most of our machines, this seems to work as expected.  But the one that did waited forever for the thread join to happen, and could never shutdown.

To address this, we set the serverSocket's SOTimeout field, so that it it will timeout, go through the do/while loop, and reevaluate the m_stop variable.  The timeout is configurable via the bundle context property "osgi.shell.telnet.SocketTimeout" and defaults to 0, the current behavior.

Patch will be attached shortly.

  was:
One one of our PCs, issuing a shutdown command to felix remote shell would hang indefinitely.  We could go to the console window and still type in commands to the local shell, and a 'ps' showed that bundle 0 and the remote-shell bundle were in "stopping" states.

The problem was in remote.shell's Listener.java.  The deactivate method seemed to be expecting the m_ServerSocket.close() call on line 70 to cause an exception in the waiting thread at line 104, the  m_ServerSocket.accept() call.

For most of our machines, this seems to work as expected.  But the one that did waited forever for the thread join to happen, and could never shutdown.

To address this, we set the serverSocket's SOTimeout field, so that it it will timeout, go through the do/while loop, and reevaluate the m_stop variable.  The timeout is configurable via the bundle context property "osgi.shell.telnet.SocketTimeout" and defaults to 0, the current behavior.

Patch will be attached shortly.


> Remote shell bundle can prevent felix shutdown
> ----------------------------------------------
>
>                 Key: FELIX-734
>                 URL: https://issues.apache.org/jira/browse/FELIX-734
>             Project: Felix
>          Issue Type: Bug
>          Components: Remote Shell
>    Affects Versions: shell.remote-1.0.2
>         Environment: felix 1.2.1, shell-remote 1.0.2
>            Reporter: Patrick Forhan
>         Attachments: RemoteShellListenerPatch.txt
>
>
> On one of our PCs, issuing a shutdown command to felix remote shell would hang indefinitely.  We could go to the console window and still type in commands to the local shell, and a 'ps' showed that bundle 0 and the remote-shell bundle were in "stopping" states.
> The problem was in remote.shell's Listener.java.  The deactivate method seemed to be expecting the m_ServerSocket.close() call on line 70 to cause an exception in the waiting thread at line 104, the  m_ServerSocket.accept() call.
> For most of our machines, this seems to work as expected.  But the one that did waited forever for the thread join to happen, and could never shutdown.
> To address this, we set the serverSocket's SOTimeout field, so that it it will timeout, go through the do/while loop, and reevaluate the m_stop variable.  The timeout is configurable via the bundle context property "osgi.shell.telnet.SocketTimeout" and defaults to 0, the current behavior.
> Patch will be attached shortly.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (FELIX-734) Remote shell bundle can prevent felix shutdown

Posted by "Felix Meschberger (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/FELIX-734?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Felix Meschberger resolved FELIX-734.
-------------------------------------

       Resolution: Fixed
    Fix Version/s:  shell.remote-1.0.4
         Assignee: Felix Meschberger

I have applied your patch, since it makes sense, regardless of my ability to reproduce the original issue.

Note, though, that for consisency  I modified the property name to "osgi.shell.telnet.socketTimeout" (lower case
s in socketTimeout).

> Remote shell bundle can prevent felix shutdown
> ----------------------------------------------
>
>                 Key: FELIX-734
>                 URL: https://issues.apache.org/jira/browse/FELIX-734
>             Project: Felix
>          Issue Type: Bug
>          Components: Remote Shell
>    Affects Versions: shell.remote-1.0.2
>         Environment: Sun JDK 1.6.0_02,
> Windows XP Pro,
> felix 1.2.1, shell-remote 1.0.2
>            Reporter: Patrick Forhan
>            Assignee: Felix Meschberger
>             Fix For:  shell.remote-1.0.4
>
>         Attachments: RemoteShellListenerPatch.txt
>
>
> On one of our PCs, issuing a shutdown command to felix remote shell would hang indefinitely.  We could go to the console window and still type in commands to the local shell, and a 'ps' showed that bundle 0 and the remote-shell bundle were in "stopping" states.
> The problem was in remote.shell's Listener.java.  The deactivate method seemed to be expecting the m_ServerSocket.close() call on line 70 to cause an exception in the waiting thread at line 104, the  m_ServerSocket.accept() call.
> For most of our machines, this seems to work as expected.  But the one that did waited forever for the thread join to happen, and could never shutdown.
> To address this, we set the serverSocket's SOTimeout field, so that it it will timeout, go through the do/while loop, and reevaluate the m_stop variable.  The timeout is configurable via the bundle context property "osgi.shell.telnet.SocketTimeout" and defaults to 0, the current behavior.
> Patch will be attached shortly.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (FELIX-734) Remote shell bundle can prevent felix shutdown

Posted by "Felix Meschberger (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/FELIX-734?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12635329#action_12635329 ] 

Felix Meschberger commented on FELIX-734:
-----------------------------------------

I can only reproduce a similar behaviour when running inside Cygwin. What I see is, that it takes a long time for the ServerSocket constructor to return. Sometime it even does not return, thus the listener thread remains "active" in the constructor. It seems that the VM hangs loading some native library. When shutting down the framework in this situation, the thread cannot be stopped and the framework just seems to be hanging.

Interestingly, when removing the shell.tui bundle, this does not happen and everything works just fine ..

Maybe someone more knowledgeable in windows networking has some clue ??

> Remote shell bundle can prevent felix shutdown
> ----------------------------------------------
>
>                 Key: FELIX-734
>                 URL: https://issues.apache.org/jira/browse/FELIX-734
>             Project: Felix
>          Issue Type: Bug
>          Components: Remote Shell
>    Affects Versions: shell.remote-1.0.2
>         Environment: Sun JDK 1.6.0_02,
> Windows XP Pro,
> felix 1.2.1, shell-remote 1.0.2
>            Reporter: Patrick Forhan
>         Attachments: RemoteShellListenerPatch.txt
>
>
> On one of our PCs, issuing a shutdown command to felix remote shell would hang indefinitely.  We could go to the console window and still type in commands to the local shell, and a 'ps' showed that bundle 0 and the remote-shell bundle were in "stopping" states.
> The problem was in remote.shell's Listener.java.  The deactivate method seemed to be expecting the m_ServerSocket.close() call on line 70 to cause an exception in the waiting thread at line 104, the  m_ServerSocket.accept() call.
> For most of our machines, this seems to work as expected.  But the one that did waited forever for the thread join to happen, and could never shutdown.
> To address this, we set the serverSocket's SOTimeout field, so that it it will timeout, go through the do/while loop, and reevaluate the m_stop variable.  The timeout is configurable via the bundle context property "osgi.shell.telnet.SocketTimeout" and defaults to 0, the current behavior.
> Patch will be attached shortly.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (FELIX-734) Remote shell bundle can prevent felix shutdown

Posted by "Patrick Forhan (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/FELIX-734?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Patrick Forhan updated FELIX-734:
---------------------------------

    Description: 

On one of our PCs, issuing a shutdown command to felix remote shell would hang indefinitely.  We could go to the console window and still type in commands to the local shell, and a 'ps' showed that bundle 0 and the remote-shell bundle were in "stopping" states.

The problem was in remote.shell's Listener.java.  The deactivate method seemed to be expecting the m_ServerSocket.close() call on line 70 to cause an exception in the waiting thread at line 104, the  m_ServerSocket.accept() call.

For most of our machines, this seems to work as expected.  But the one that did waited forever for the thread join to happen, and could never shutdown.

To address this, we set the serverSocket's SOTimeout field, so that it it will timeout, go through the do/while loop, and reevaluate the m_stop variable.  The timeout is configurable via the bundle context property "osgi.shell.telnet.SocketTimeout" and defaults to 0, the current behavior.

Patch will be attached shortly.

  was:
On one of our PCs, issuing a shutdown command to felix remote shell would hang indefinitely.  We could go to the console window and still type in commands to the local shell, and a 'ps' showed that bundle 0 and the remote-shell bundle were in "stopping" states.

The problem was in remote.shell's Listener.java.  The deactivate method seemed to be expecting the m_ServerSocket.close() call on line 70 to cause an exception in the waiting thread at line 104, the  m_ServerSocket.accept() call.

For most of our machines, this seems to work as expected.  But the one that did waited forever for the thread join to happen, and could never shutdown.

To address this, we set the serverSocket's SOTimeout field, so that it it will timeout, go through the do/while loop, and reevaluate the m_stop variable.  The timeout is configurable via the bundle context property "osgi.shell.telnet.SocketTimeout" and defaults to 0, the current behavior.

Patch will be attached shortly.

    Environment: 
Sun JDK 1.6.0_02,
Windows XP Pro,
felix 1.2.1, shell-remote 1.0.2

  was:felix 1.2.1, shell-remote 1.0.2


> Remote shell bundle can prevent felix shutdown
> ----------------------------------------------
>
>                 Key: FELIX-734
>                 URL: https://issues.apache.org/jira/browse/FELIX-734
>             Project: Felix
>          Issue Type: Bug
>          Components: Remote Shell
>    Affects Versions: shell.remote-1.0.2
>         Environment: Sun JDK 1.6.0_02,
> Windows XP Pro,
> felix 1.2.1, shell-remote 1.0.2
>            Reporter: Patrick Forhan
>         Attachments: RemoteShellListenerPatch.txt
>
>
> On one of our PCs, issuing a shutdown command to felix remote shell would hang indefinitely.  We could go to the console window and still type in commands to the local shell, and a 'ps' showed that bundle 0 and the remote-shell bundle were in "stopping" states.
> The problem was in remote.shell's Listener.java.  The deactivate method seemed to be expecting the m_ServerSocket.close() call on line 70 to cause an exception in the waiting thread at line 104, the  m_ServerSocket.accept() call.
> For most of our machines, this seems to work as expected.  But the one that did waited forever for the thread join to happen, and could never shutdown.
> To address this, we set the serverSocket's SOTimeout field, so that it it will timeout, go through the do/while loop, and reevaluate the m_stop variable.  The timeout is configurable via the bundle context property "osgi.shell.telnet.SocketTimeout" and defaults to 0, the current behavior.
> Patch will be attached shortly.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Issue Comment Edited: (FELIX-734) Remote shell bundle can prevent felix shutdown

Posted by "Felix Meschberger (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/FELIX-734?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12635329#action_12635329 ] 

fmeschbe edited comment on FELIX-734 at 9/29/08 3:07 AM:
------------------------------------------------------------------

I can only reproduce a similar behaviour when running inside Cygwin. What I see is, that it takes a long time for the ServerSocket constructor to return. Sometime it even does not return, thus the listener thread remains "active" in the constructor. It seems that the VM hangs loading some native library. When shutting down the framework in this situation, the thread cannot be stopped and the framework just seems to be hanging.

Interestingly, when removing the shell.tui bundle, this does not happen and everything works just fine ..

Maybe someone more knowledgeable in windows networking has some clue ??

Unfortunately, at least in my case, applying the patch won't help, because it is the ServerSocket constructor blocking the stuff ...

      was (Author: fmeschbe):
    I can only reproduce a similar behaviour when running inside Cygwin. What I see is, that it takes a long time for the ServerSocket constructor to return. Sometime it even does not return, thus the listener thread remains "active" in the constructor. It seems that the VM hangs loading some native library. When shutting down the framework in this situation, the thread cannot be stopped and the framework just seems to be hanging.

Interestingly, when removing the shell.tui bundle, this does not happen and everything works just fine ..

Maybe someone more knowledgeable in windows networking has some clue ??
  
> Remote shell bundle can prevent felix shutdown
> ----------------------------------------------
>
>                 Key: FELIX-734
>                 URL: https://issues.apache.org/jira/browse/FELIX-734
>             Project: Felix
>          Issue Type: Bug
>          Components: Remote Shell
>    Affects Versions: shell.remote-1.0.2
>         Environment: Sun JDK 1.6.0_02,
> Windows XP Pro,
> felix 1.2.1, shell-remote 1.0.2
>            Reporter: Patrick Forhan
>         Attachments: RemoteShellListenerPatch.txt
>
>
> On one of our PCs, issuing a shutdown command to felix remote shell would hang indefinitely.  We could go to the console window and still type in commands to the local shell, and a 'ps' showed that bundle 0 and the remote-shell bundle were in "stopping" states.
> The problem was in remote.shell's Listener.java.  The deactivate method seemed to be expecting the m_ServerSocket.close() call on line 70 to cause an exception in the waiting thread at line 104, the  m_ServerSocket.accept() call.
> For most of our machines, this seems to work as expected.  But the one that did waited forever for the thread join to happen, and could never shutdown.
> To address this, we set the serverSocket's SOTimeout field, so that it it will timeout, go through the do/while loop, and reevaluate the m_stop variable.  The timeout is configurable via the bundle context property "osgi.shell.telnet.SocketTimeout" and defaults to 0, the current behavior.
> Patch will be attached shortly.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (FELIX-734) Remote shell bundle can prevent felix shutdown

Posted by "Patrick Forhan (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/FELIX-734?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Patrick Forhan updated FELIX-734:
---------------------------------

    Attachment: RemoteShellListenerPatch.txt

> Remote shell bundle can prevent felix shutdown
> ----------------------------------------------
>
>                 Key: FELIX-734
>                 URL: https://issues.apache.org/jira/browse/FELIX-734
>             Project: Felix
>          Issue Type: Bug
>          Components: Remote Shell
>    Affects Versions: shell.remote-1.0.2
>         Environment: felix 1.2.1, shell-remote 1.0.2
>            Reporter: Patrick Forhan
>         Attachments: RemoteShellListenerPatch.txt
>
>
> One one of our PCs, issuing a shutdown command to felix remote shell would hang indefinitely.  We could go to the console window and still type in commands to the local shell, and a 'ps' showed that bundle 0 and the remote-shell bundle were in "stopping" states.
> The problem was in remote.shell's Listener.java.  The deactivate method seemed to be expecting the m_ServerSocket.close() call on line 70 to cause an exception in the waiting thread at line 104, the  m_ServerSocket.accept() call.
> For most of our machines, this seems to work as expected.  But the one that did waited forever for the thread join to happen, and could never shutdown.
> To address this, we set the serverSocket's SOTimeout field, so that it it will timeout, go through the do/while loop, and reevaluate the m_stop variable.  The timeout is configurable via the bundle context property "osgi.shell.telnet.SocketTimeout" and defaults to 0, the current behavior.
> Patch will be attached shortly.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (FELIX-734) Remote shell bundle can prevent felix shutdown

Posted by "Patrick Forhan (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/FELIX-734?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Patrick Forhan updated FELIX-734:
---------------------------------

    Environment: felix 1.2.1, shell-remote 1.0.2  (was: felix 1.2.0, shell-remote 1.0.2)

> Remote shell bundle can prevent felix shutdown
> ----------------------------------------------
>
>                 Key: FELIX-734
>                 URL: https://issues.apache.org/jira/browse/FELIX-734
>             Project: Felix
>          Issue Type: Bug
>          Components: Remote Shell
>    Affects Versions: shell.remote-1.0.2
>         Environment: felix 1.2.1, shell-remote 1.0.2
>            Reporter: Patrick Forhan
>
> One one of our PCs, issuing a shutdown command to felix remote shell would hang indefinitely.  We could go to the console window and still type in commands to the local shell, and a 'ps' showed that bundle 0 and the remote-shell bundle were in "stopping" states.
> The problem was in remote.shell's Listener.java.  The deactivate method seemed to be expecting the m_ServerSocket.close() call on line 70 to cause an exception in the waiting thread at line 104, the  m_ServerSocket.accept() call.
> For most of our machines, this seems to work as expected.  But the one that did waited forever for the thread join to happen, and could never shutdown.
> To address this, we set the serverSocket's SOTimeout field, so that it it will timeout, go through the do/while loop, and reevaluate the m_stop variable.  The timeout is configurable via the bundle context property "osgi.shell.telnet.SocketTimeout" and defaults to 0, the current behavior.
> Patch will be attached shortly.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.