You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by "Andreas Veithen (JIRA)" <ji...@apache.org> on 2009/11/13 23:10:39 UTC

[jira] Created: (AXIS2-4552) TransportListener#init called twice on the same instance

TransportListener#init called twice on the same instance
--------------------------------------------------------

                 Key: AXIS2-4552
                 URL: https://issues.apache.org/jira/browse/AXIS2-4552
             Project: Axis 2.0 (Axis2)
          Issue Type: Bug
          Components: kernel
    Affects Versions: nightly
            Reporter: Andreas Veithen
             Fix For: 1.6


It seems that under some circumstances, the init method of the same TransportListener instance is called twice during the lifecycle of the listener. Evidence can be found here:

http://markmail.org/thread/25ksz5k2pnunxkpd
http://svn.apache.org/viewvc?rev=835750&view=rev

This is of course incorrect: the init method must be called only once on a given instance. This is probably a regression with respect to 1.5 caused by Ruwan's patch (or Glen's corrections to that patch) for
AXIS2-4304. This is a major issue since it causes uncontrollable resource leakage (thread pools, timers, etc.).

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


[jira] Commented: (AXIS2-4552) TransportListener#init called twice on the same instance

Posted by "Amila Chinthaka Suriarachchi (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AXIS2-4552?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12778205#action_12778205 ] 

Amila Chinthaka Suriarachchi commented on AXIS2-4552:
-----------------------------------------------------

try do the thing which Andreas has mentioned using Axis2 service client. 



> TransportListener#init called twice on the same instance
> --------------------------------------------------------
>
>                 Key: AXIS2-4552
>                 URL: https://issues.apache.org/jira/browse/AXIS2-4552
>             Project: Axis 2.0 (Axis2)
>          Issue Type: Bug
>          Components: kernel
>    Affects Versions: nightly
>            Reporter: Andreas Veithen
>             Fix For: 1.6
>
>
> It seems that under some circumstances, the init method of the same TransportListener instance is called twice during the lifecycle of the listener. Evidence can be found here:
> http://markmail.org/thread/25ksz5k2pnunxkpd
> http://svn.apache.org/viewvc?rev=835750&view=rev
> This is of course incorrect: the init method must be called only once on a given instance. This is probably a regression caused by Ruwan's patch (or Glen's corrections to that patch) for AXIS2-4304 [Note: if this is the case then probably Axis2 1.5 is also affected]. This is a major issue since it causes uncontrollable resource leakage (thread pools, timers, etc.).

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


[jira] Updated: (AXIS2-4552) TransportListener#init called twice on the same instance

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

Andreas Veithen updated AXIS2-4552:
-----------------------------------

    Description: 
It seems that under some circumstances, the init method of the same TransportListener instance is called twice during the lifecycle of the listener. Evidence can be found here:

http://markmail.org/thread/25ksz5k2pnunxkpd
http://svn.apache.org/viewvc?rev=835750&view=rev

This is of course incorrect: the init method must be called only once on a given instance. This is probably a regression caused by Ruwan's patch (or Glen's corrections to that patch) for AXIS2-4304 [Note: if this is the case then probably Axis2 1.5 is also affected]. This is a major issue since it causes uncontrollable resource leakage (thread pools, timers, etc.).

  was:
It seems that under some circumstances, the init method of the same TransportListener instance is called twice during the lifecycle of the listener. Evidence can be found here:

http://markmail.org/thread/25ksz5k2pnunxkpd
http://svn.apache.org/viewvc?rev=835750&view=rev

This is of course incorrect: the init method must be called only once on a given instance. This is probably a regression with respect to 1.5 caused by Ruwan's patch (or Glen's corrections to that patch) for
AXIS2-4304. This is a major issue since it causes uncontrollable resource leakage (thread pools, timers, etc.).


> TransportListener#init called twice on the same instance
> --------------------------------------------------------
>
>                 Key: AXIS2-4552
>                 URL: https://issues.apache.org/jira/browse/AXIS2-4552
>             Project: Axis 2.0 (Axis2)
>          Issue Type: Bug
>          Components: kernel
>    Affects Versions: nightly
>            Reporter: Andreas Veithen
>             Fix For: 1.6
>
>
> It seems that under some circumstances, the init method of the same TransportListener instance is called twice during the lifecycle of the listener. Evidence can be found here:
> http://markmail.org/thread/25ksz5k2pnunxkpd
> http://svn.apache.org/viewvc?rev=835750&view=rev
> This is of course incorrect: the init method must be called only once on a given instance. This is probably a regression caused by Ruwan's patch (or Glen's corrections to that patch) for AXIS2-4304 [Note: if this is the case then probably Axis2 1.5 is also affected]. This is a major issue since it causes uncontrollable resource leakage (thread pools, timers, etc.).

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


[jira] Commented: (AXIS2-4552) TransportListener#init called twice on the same instance

Posted by "Ruwan Linton (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AXIS2-4552?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12778850#action_12778850 ] 

Ruwan Linton commented on AXIS2-4552:
-------------------------------------

Amila, if you carefully look at the addListener method there is a boolean flag called started, which is used when adding a listener which has already been initialized and started. That is why I was saying that you cannot just init and add the listener without starting, if you init it you need to start it before adding and pass started as true to the addListener method.

This change has been done purposely... for a synapse requirement. Anyway initializing the listeners when the listener manager is initializing a logical then doing it at the start method.

Thanks,
Ruwan

> TransportListener#init called twice on the same instance
> --------------------------------------------------------
>
>                 Key: AXIS2-4552
>                 URL: https://issues.apache.org/jira/browse/AXIS2-4552
>             Project: Axis 2.0 (Axis2)
>          Issue Type: Bug
>          Components: kernel
>    Affects Versions: nightly
>            Reporter: Andreas Veithen
>             Fix For: 1.6
>
>
> It seems that under some circumstances, the init method of the same TransportListener instance is called twice during the lifecycle of the listener. Evidence can be found here:
> http://markmail.org/thread/25ksz5k2pnunxkpd
> http://svn.apache.org/viewvc?rev=835750&view=rev
> This is of course incorrect: the init method must be called only once on a given instance. This is probably a regression caused by Ruwan's patch (or Glen's corrections to that patch) for AXIS2-4304 [Note: if this is the case then probably Axis2 1.5 is also affected]. This is a major issue since it causes uncontrollable resource leakage (thread pools, timers, etc.).

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


[jira] Commented: (AXIS2-4552) TransportListener#init called twice on the same instance

Posted by "Andreas Veithen (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AXIS2-4552?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12777909#action_12777909 ] 

Andreas Veithen commented on AXIS2-4552:
----------------------------------------

Thanks Ruwan for looking into this issue. Note that I didn't see the issue occurring myself, so I can't provide more information. According to Amila, it occurs with "a simple send and receive invocation with mail transport".

Amila,

Can you provide more information or maybe even a test case?

> TransportListener#init called twice on the same instance
> --------------------------------------------------------
>
>                 Key: AXIS2-4552
>                 URL: https://issues.apache.org/jira/browse/AXIS2-4552
>             Project: Axis 2.0 (Axis2)
>          Issue Type: Bug
>          Components: kernel
>    Affects Versions: nightly
>            Reporter: Andreas Veithen
>             Fix For: 1.6
>
>
> It seems that under some circumstances, the init method of the same TransportListener instance is called twice during the lifecycle of the listener. Evidence can be found here:
> http://markmail.org/thread/25ksz5k2pnunxkpd
> http://svn.apache.org/viewvc?rev=835750&view=rev
> This is of course incorrect: the init method must be called only once on a given instance. This is probably a regression caused by Ruwan's patch (or Glen's corrections to that patch) for AXIS2-4304 [Note: if this is the case then probably Axis2 1.5 is also affected]. This is a major issue since it causes uncontrollable resource leakage (thread pools, timers, etc.).

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


[jira] Commented: (AXIS2-4552) TransportListener#init called twice on the same instance

Posted by "Ruwan Linton (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AXIS2-4552?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12777907#action_12777907 ] 

Ruwan Linton commented on AXIS2-4552:
-------------------------------------

If you carefully look at the current ListenerManager implementation, only possibility that this could occur is if some one tries to add an already started transport to the listener manager without letting the listener manager know that it is started. Well, it could be that the listener is manually initialized but not started, and some code should be trying to add that particular listener to the listener manager.

If that is the case I would say that is a wrong usage of the listener manager API, I agree we need a bit of API documentation to the listener manager here. I will try to add that soon. So the solution is if you take control of the initialization of the listener you should also take the responsibility of starting it before adding to the listener manager and you should inform that this particular listener has been already started to the listener manager.

I will search for such usages of the listener manager, but if you know of a place where we do this please point me so that you can save a bit of my time.

With the above explanation I don't see any issues with the patch that I have provided nor the current listener manager implementation except for some missing API documentation.

> TransportListener#init called twice on the same instance
> --------------------------------------------------------
>
>                 Key: AXIS2-4552
>                 URL: https://issues.apache.org/jira/browse/AXIS2-4552
>             Project: Axis 2.0 (Axis2)
>          Issue Type: Bug
>          Components: kernel
>    Affects Versions: nightly
>            Reporter: Andreas Veithen
>             Fix For: 1.6
>
>
> It seems that under some circumstances, the init method of the same TransportListener instance is called twice during the lifecycle of the listener. Evidence can be found here:
> http://markmail.org/thread/25ksz5k2pnunxkpd
> http://svn.apache.org/viewvc?rev=835750&view=rev
> This is of course incorrect: the init method must be called only once on a given instance. This is probably a regression caused by Ruwan's patch (or Glen's corrections to that patch) for AXIS2-4304 [Note: if this is the case then probably Axis2 1.5 is also affected]. This is a major issue since it causes uncontrollable resource leakage (thread pools, timers, etc.).

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


[jira] Commented: (AXIS2-4552) TransportListener#init called twice on the same instance

Posted by "Ruwan Linton (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AXIS2-4552?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12777931#action_12777931 ] 

Ruwan Linton commented on AXIS2-4552:
-------------------------------------

Andreas, I searched through the code to find any usages that are using the listener manager in a wrong manner and found few suspect points. I will analyse this further and try to fix it.

Amila, it will be very helpful, if you could provide a test case to reproduce this.

> TransportListener#init called twice on the same instance
> --------------------------------------------------------
>
>                 Key: AXIS2-4552
>                 URL: https://issues.apache.org/jira/browse/AXIS2-4552
>             Project: Axis 2.0 (Axis2)
>          Issue Type: Bug
>          Components: kernel
>    Affects Versions: nightly
>            Reporter: Andreas Veithen
>             Fix For: 1.6
>
>
> It seems that under some circumstances, the init method of the same TransportListener instance is called twice during the lifecycle of the listener. Evidence can be found here:
> http://markmail.org/thread/25ksz5k2pnunxkpd
> http://svn.apache.org/viewvc?rev=835750&view=rev
> This is of course incorrect: the init method must be called only once on a given instance. This is probably a regression caused by Ruwan's patch (or Glen's corrections to that patch) for AXIS2-4304 [Note: if this is the case then probably Axis2 1.5 is also affected]. This is a major issue since it causes uncontrollable resource leakage (thread pools, timers, etc.).

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


[jira] Commented: (AXIS2-4552) TransportListener#init called twice on the same instance

Posted by "Amila Chinthaka Suriarachchi (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AXIS2-4552?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12778277#action_12778277 ] 

Amila Chinthaka Suriarachchi commented on AXIS2-4552:
-----------------------------------------------------

with your patch to AXIS2-4304 you have initialize all the 
transports at the init method and only remove the initialization at the start method.

but addListner method still have the call to init method.

if there is no reason for this change better to revert it. other wise please change the addListner method also and properly test.

> TransportListener#init called twice on the same instance
> --------------------------------------------------------
>
>                 Key: AXIS2-4552
>                 URL: https://issues.apache.org/jira/browse/AXIS2-4552
>             Project: Axis 2.0 (Axis2)
>          Issue Type: Bug
>          Components: kernel
>    Affects Versions: nightly
>            Reporter: Andreas Veithen
>             Fix For: 1.6
>
>
> It seems that under some circumstances, the init method of the same TransportListener instance is called twice during the lifecycle of the listener. Evidence can be found here:
> http://markmail.org/thread/25ksz5k2pnunxkpd
> http://svn.apache.org/viewvc?rev=835750&view=rev
> This is of course incorrect: the init method must be called only once on a given instance. This is probably a regression caused by Ruwan's patch (or Glen's corrections to that patch) for AXIS2-4304 [Note: if this is the case then probably Axis2 1.5 is also affected]. This is a major issue since it causes uncontrollable resource leakage (thread pools, timers, etc.).

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


[jira] Commented: (AXIS2-4552) TransportListener#init called twice on the same instance

Posted by "Amila Chinthaka Suriarachchi (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AXIS2-4552?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12778966#action_12778966 ] 

Amila Chinthaka Suriarachchi commented on AXIS2-4552:
-----------------------------------------------------

if you carefully look at the addListener method there is a boolean flag called started, which is used when adding a listener which has already been initialized and started

Are you sure? I think this method was there before your change. So at that time it assumes init is not called if the start is not called.


That is why I was saying that you cannot just init and add the listener without starting

I think the init method is called because of your change. At the ListnerManager init method it calls init for all transport listners.


> TransportListener#init called twice on the same instance
> --------------------------------------------------------
>
>                 Key: AXIS2-4552
>                 URL: https://issues.apache.org/jira/browse/AXIS2-4552
>             Project: Axis 2.0 (Axis2)
>          Issue Type: Bug
>          Components: kernel
>    Affects Versions: nightly
>            Reporter: Andreas Veithen
>             Fix For: 1.6
>
>
> It seems that under some circumstances, the init method of the same TransportListener instance is called twice during the lifecycle of the listener. Evidence can be found here:
> http://markmail.org/thread/25ksz5k2pnunxkpd
> http://svn.apache.org/viewvc?rev=835750&view=rev
> This is of course incorrect: the init method must be called only once on a given instance. This is probably a regression caused by Ruwan's patch (or Glen's corrections to that patch) for AXIS2-4304 [Note: if this is the case then probably Axis2 1.5 is also affected]. This is a major issue since it causes uncontrollable resource leakage (thread pools, timers, etc.).

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