You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@felix.apache.org by "Tomas Pan (JIRA)" <ji...@apache.org> on 2012/10/07 21:36:02 UTC

[jira] [Created] (FELIX-3703) Race condition in gogo runtime activator

Tomas Pan created FELIX-3703:
--------------------------------

             Summary: Race condition in gogo runtime activator
                 Key: FELIX-3703
                 URL: https://issues.apache.org/jira/browse/FELIX-3703
             Project: Felix
          Issue Type: Bug
          Components: Gogo Runtime
    Affects Versions: gogo.runtime-0.10.0
         Environment: Embedded felix 4.0.3
            Reporter: Tomas Pan


Starting gogo.command (0.12.0) before gogo.runtime(0.10.0) produces CommandNotFoundException: Command not found: gosh.
This is because runtime's Activator first registers CommandProcessor before creating commandTracker.
Creating CommandProcessor triggers event on .command which will start adding commands, but since commandTracker is not present, those commands will be ignored.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Resolved] (FELIX-3703) Race condition in gogo runtime activator

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

Derek Baum resolved FELIX-3703.
-------------------------------

       Resolution: Fixed
    Fix Version/s: gogo.shell-0.12.0
         Assignee: Derek Baum

fixed by FELIX-3706.
                
> Race condition in gogo runtime activator
> ----------------------------------------
>
>                 Key: FELIX-3703
>                 URL: https://issues.apache.org/jira/browse/FELIX-3703
>             Project: Felix
>          Issue Type: Bug
>          Components: Gogo Runtime
>    Affects Versions: gogo.runtime-0.10.0
>         Environment: Embedded felix 4.0.3
>            Reporter: Tomas Pan
>            Assignee: Derek Baum
>             Fix For: gogo.shell-0.12.0
>
>         Attachments: my.patch, osgi-embedded.zip
>
>
> Starting gogo.command (0.12.0) before gogo.runtime(0.10.0) produces CommandNotFoundException: Command not found: gosh.
> This is because runtime's Activator first registers CommandProcessor before creating commandTracker.
> Creating CommandProcessor triggers event on .command which will start adding commands, but since commandTracker is not present, those commands will be ignored.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (FELIX-3703) Race condition in gogo runtime activator

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

Tomas Pan updated FELIX-3703:
-----------------------------

    Attachment: osgi-embedded.zip

test case
                
> Race condition in gogo runtime activator
> ----------------------------------------
>
>                 Key: FELIX-3703
>                 URL: https://issues.apache.org/jira/browse/FELIX-3703
>             Project: Felix
>          Issue Type: Bug
>          Components: Gogo Runtime
>    Affects Versions: gogo.runtime-0.10.0
>         Environment: Embedded felix 4.0.3
>            Reporter: Tomas Pan
>         Attachments: my.patch, osgi-embedded.zip
>
>
> Starting gogo.command (0.12.0) before gogo.runtime(0.10.0) produces CommandNotFoundException: Command not found: gosh.
> This is because runtime's Activator first registers CommandProcessor before creating commandTracker.
> Creating CommandProcessor triggers event on .command which will start adding commands, but since commandTracker is not present, those commands will be ignored.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (FELIX-3703) Race condition in gogo runtime activator

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

Tomas Pan commented on FELIX-3703:
----------------------------------

Hi Derek, perhaps I am doing something wrong during initialization, please find attached test case. When I start runtime after command and shell, I don't see the gogo shell and the "Gogo shell" thread is killed by this exception:
gogo: CommandNotFoundException: Command not found: gosh
org.apache.felix.gogo.runtime.CommandNotFoundException: Command not found: gosh
	at org.apache.felix.gogo.runtime.Closure.executeCmd(Closure.java:474)
	at org.apache.felix.gogo.runtime.Closure.executeStatement(Closure.java:403)
	at org.apache.felix.gogo.runtime.Pipe.run(Pipe.java:108)
	at org.apache.felix.gogo.runtime.Closure.execute(Closure.java:183)
	at org.apache.felix.gogo.runtime.Closure.execute(Closure.java:120)
	at org.apache.felix.gogo.runtime.CommandSessionImpl.execute(CommandSessionImpl.java:89)
	at org.apache.felix.gogo.shell.Activator.run(Activator.java:75)
	at java.lang.Thread.run(Thread.java:662)
                
> Race condition in gogo runtime activator
> ----------------------------------------
>
>                 Key: FELIX-3703
>                 URL: https://issues.apache.org/jira/browse/FELIX-3703
>             Project: Felix
>          Issue Type: Bug
>          Components: Gogo Runtime
>    Affects Versions: gogo.runtime-0.10.0
>         Environment: Embedded felix 4.0.3
>            Reporter: Tomas Pan
>         Attachments: my.patch, osgi-embedded.zip
>
>
> Starting gogo.command (0.12.0) before gogo.runtime(0.10.0) produces CommandNotFoundException: Command not found: gosh.
> This is because runtime's Activator first registers CommandProcessor before creating commandTracker.
> Creating CommandProcessor triggers event on .command which will start adding commands, but since commandTracker is not present, those commands will be ignored.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (FELIX-3703) Race condition in gogo runtime activator

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

Tomas Pan updated FELIX-3703:
-----------------------------

    Attachment: my.patch

patch
                
> Race condition in gogo runtime activator
> ----------------------------------------
>
>                 Key: FELIX-3703
>                 URL: https://issues.apache.org/jira/browse/FELIX-3703
>             Project: Felix
>          Issue Type: Bug
>          Components: Gogo Runtime
>    Affects Versions: gogo.runtime-0.10.0
>         Environment: Embedded felix 4.0.3
>            Reporter: Tomas Pan
>         Attachments: my.patch
>
>
> Starting gogo.command (0.12.0) before gogo.runtime(0.10.0) produces CommandNotFoundException: Command not found: gosh.
> This is because runtime's Activator first registers CommandProcessor before creating commandTracker.
> Creating CommandProcessor triggers event on .command which will start adding commands, but since commandTracker is not present, those commands will be ignored.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (FELIX-3703) Race condition in gogo runtime activator

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

Derek Baum commented on FELIX-3703:
-----------------------------------

Hi Thomas,

Thanks for the stack trace and test case.

Coincidently, I recently filed FELIX-3706 which fixes this problem.
(I didn't realise it was the same problem until I saw the stack trace).

Your test case works if you use gogo-shell-0.11.0-SNAPSHOT, using the subversion HEAD containing the fix for FELIX-3706.
                
> Race condition in gogo runtime activator
> ----------------------------------------
>
>                 Key: FELIX-3703
>                 URL: https://issues.apache.org/jira/browse/FELIX-3703
>             Project: Felix
>          Issue Type: Bug
>          Components: Gogo Runtime
>    Affects Versions: gogo.runtime-0.10.0
>         Environment: Embedded felix 4.0.3
>            Reporter: Tomas Pan
>         Attachments: my.patch, osgi-embedded.zip
>
>
> Starting gogo.command (0.12.0) before gogo.runtime(0.10.0) produces CommandNotFoundException: Command not found: gosh.
> This is because runtime's Activator first registers CommandProcessor before creating commandTracker.
> Creating CommandProcessor triggers event on .command which will start adding commands, but since commandTracker is not present, those commands will be ignored.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (FELIX-3703) Race condition in gogo runtime activator

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

Derek Baum commented on FELIX-3703:
-----------------------------------

Hi Thomas,

The gogo:gosh command is provided by the Shell bundle, not the Command bundle and is therefore present even if the Command bundle is not started.

I cannot reproduce the condition you describe, even if I start the Shell bundle before the Runtime bundle.

A ServiceTracker is used to locate gogo commands in other bundles. It should not matter when this tracker is started, as it gives an initial list of matching services and then updates and new services appear.

The patch you provided caused a NPE at Activator:156 where the process field is accessed.

Please provide more details of your problem, ideally a test-case.

                
> Race condition in gogo runtime activator
> ----------------------------------------
>
>                 Key: FELIX-3703
>                 URL: https://issues.apache.org/jira/browse/FELIX-3703
>             Project: Felix
>          Issue Type: Bug
>          Components: Gogo Runtime
>    Affects Versions: gogo.runtime-0.10.0
>         Environment: Embedded felix 4.0.3
>            Reporter: Tomas Pan
>         Attachments: my.patch
>
>
> Starting gogo.command (0.12.0) before gogo.runtime(0.10.0) produces CommandNotFoundException: Command not found: gosh.
> This is because runtime's Activator first registers CommandProcessor before creating commandTracker.
> Creating CommandProcessor triggers event on .command which will start adding commands, but since commandTracker is not present, those commands will be ignored.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira