You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@directory.apache.org by "Daniel Fisher (JIRA)" <ji...@apache.org> on 2011/05/09 03:20:03 UTC

[jira] [Created] (DIRSHARED-125) Felix not properly shutdown

Felix not properly shutdown
---------------------------

                 Key: DIRSHARED-125
                 URL: https://issues.apache.org/jira/browse/DIRSHARED-125
             Project: Directory Shared
          Issue Type: Bug
    Affects Versions: 1.0.0-M3
            Reporter: Daniel Fisher
             Fix For: 1.0.0-M4


The LdapNetworkConnection initializes an instance of Felix but never shuts it down. 
See the thread at: http://mail-archives.apache.org/mod_mbox/directory-api/201105.mbox/thread

You may also want to review the LdapCodecServiceFactory class for thread safety.


--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (DIRSHARED-125) Felix not properly shutdown

Posted by "Emmanuel Lecharny (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DIRSHARED-125?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13031073#comment-13031073 ] 

Emmanuel Lecharny commented on DIRSHARED-125:
---------------------------------------------

My be using a JVM shutdown hook can help here. To be investigated.

> Felix not properly shutdown
> ---------------------------
>
>                 Key: DIRSHARED-125
>                 URL: https://issues.apache.org/jira/browse/DIRSHARED-125
>             Project: Directory Shared
>          Issue Type: Bug
>    Affects Versions: 1.0.0-M3
>            Reporter: Daniel Fisher
>             Fix For: 1.0.0-M4
>
>
> The LdapNetworkConnection initializes an instance of Felix but never shuts it down. 
> See the thread at: http://mail-archives.apache.org/mod_mbox/directory-api/201105.mbox/thread
> You may also want to review the LdapCodecServiceFactory class for thread safety.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (DIRSHARED-125) Felix not properly shutdown

Posted by "Emmanuel Lecharny (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DIRSHARED-125?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13031233#comment-13031233 ] 

Emmanuel Lecharny commented on DIRSHARED-125:
---------------------------------------------

At the moment, I have exposed the LdapConnection.shutdown() methods that stop the internal OSGi container.

This is ore or less a hack. We have to find a better solution.

Doing something like :
  public static void main(String[] args) throws Exception
  {
    LdapNetworkConnection lc = new LdapNetworkConnection();

    lc.shutdown();
  }

will properly shutdown Felix

> Felix not properly shutdown
> ---------------------------
>
>                 Key: DIRSHARED-125
>                 URL: https://issues.apache.org/jira/browse/DIRSHARED-125
>             Project: Directory Shared
>          Issue Type: Bug
>    Affects Versions: 1.0.0-M3
>            Reporter: Daniel Fisher
>             Fix For: 1.0.0-M4
>
>
> The LdapNetworkConnection initializes an instance of Felix but never shuts it down. 
> See the thread at: http://mail-archives.apache.org/mod_mbox/directory-api/201105.mbox/thread
> You may also want to review the LdapCodecServiceFactory class for thread safety.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (DIRSHARED-125) Felix not properly shutdown

Posted by "Daniel Fisher (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DIRSHARED-125?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13031273#comment-13031273 ] 

Daniel Fisher commented on DIRSHARED-125:
-----------------------------------------

I don't want to derail this issue, but could you explain what felix is being used for? I was surprised to see it as part of the client code.


> Felix not properly shutdown
> ---------------------------
>
>                 Key: DIRSHARED-125
>                 URL: https://issues.apache.org/jira/browse/DIRSHARED-125
>             Project: Directory Shared
>          Issue Type: Bug
>    Affects Versions: 1.0.0-M3
>            Reporter: Daniel Fisher
>             Fix For: 1.0.0-M4
>
>
> The LdapNetworkConnection initializes an instance of Felix but never shuts it down. 
> See the thread at: http://mail-archives.apache.org/mod_mbox/directory-api/201105.mbox/thread
> You may also want to review the LdapCodecServiceFactory class for thread safety.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (DIRSHARED-125) Felix not properly shutdown

Posted by "Emmanuel Lecharny (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DIRSHARED-125?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13031414#comment-13031414 ] 

Emmanuel Lecharny commented on DIRSHARED-125:
---------------------------------------------

Basically, we use a OSGi container to allow us to extend the API. We have many extensions points :
- the network layer
- Schema elements that can e added (SyntaxCheckers, Normalizers, Comparators)
- Controls
- Extended operations
- Stored Procedure (server side)

The API is used internally by the ApacheDS server and by Studio, which both use a OSGi container (Eclipse's one for Studio, Felix or whatever the user selects for ADS).

If you use an OSGi container in your application, then Felix won't be started at all, we wil use your container.

> Felix not properly shutdown
> ---------------------------
>
>                 Key: DIRSHARED-125
>                 URL: https://issues.apache.org/jira/browse/DIRSHARED-125
>             Project: Directory Shared
>          Issue Type: Bug
>    Affects Versions: 1.0.0-M3
>            Reporter: Daniel Fisher
>             Fix For: 1.0.0-M4
>
>
> The LdapNetworkConnection initializes an instance of Felix but never shuts it down. 
> See the thread at: http://mail-archives.apache.org/mod_mbox/directory-api/201105.mbox/thread
> You may also want to review the LdapCodecServiceFactory class for thread safety.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (DIRSHARED-125) Felix not properly shutdown

Posted by "Daniel Fisher (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DIRSHARED-125?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13031887#comment-13031887 ] 

Daniel Fisher commented on DIRSHARED-125:
-----------------------------------------

Thanks for the OSGI description. I would expect all the resources created by the LdapConnection to be freed when it gets garbage collected. (That may be an invalid assumption...) Should felix be shutdown in StandaloneLdapCodecService#finalize() or some other singleton?

> Felix not properly shutdown
> ---------------------------
>
>                 Key: DIRSHARED-125
>                 URL: https://issues.apache.org/jira/browse/DIRSHARED-125
>             Project: Directory Shared
>          Issue Type: Bug
>    Affects Versions: 1.0.0-M3
>            Reporter: Daniel Fisher
>             Fix For: 1.0.0-M4
>
>
> The LdapNetworkConnection initializes an instance of Felix but never shuts it down. 
> See the thread at: http://mail-archives.apache.org/mod_mbox/directory-api/201105.mbox/thread
> You may also want to review the LdapCodecServiceFactory class for thread safety.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (DIRSHARED-125) Felix not properly shutdown

Posted by "Emmanuel Lecharny (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DIRSHARED-125?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13031800#comment-13031800 ] 

Emmanuel Lecharny commented on DIRSHARED-125:
---------------------------------------------

Right now, in trunk, the way we initialize felix has been changed, and now, the container will properly shutdown when you leave the JVM. The Felix threads will be deamon threads.

Otherwise, we currently are discussing about the need to have felix launched inside the API. Not sure it's a valid option...

> Felix not properly shutdown
> ---------------------------
>
>                 Key: DIRSHARED-125
>                 URL: https://issues.apache.org/jira/browse/DIRSHARED-125
>             Project: Directory Shared
>          Issue Type: Bug
>    Affects Versions: 1.0.0-M3
>            Reporter: Daniel Fisher
>             Fix For: 1.0.0-M4
>
>
> The LdapNetworkConnection initializes an instance of Felix but never shuts it down. 
> See the thread at: http://mail-archives.apache.org/mod_mbox/directory-api/201105.mbox/thread
> You may also want to review the LdapCodecServiceFactory class for thread safety.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (DIRSHARED-125) Felix not properly shutdown

Posted by "Emmanuel Lecharny (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DIRSHARED-125?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13036213#comment-13036213 ] 

Emmanuel Lecharny commented on DIRSHARED-125:
---------------------------------------------

The Felix container has been removed from the client API. Seems useless.

> Felix not properly shutdown
> ---------------------------
>
>                 Key: DIRSHARED-125
>                 URL: https://issues.apache.org/jira/browse/DIRSHARED-125
>             Project: Directory Shared
>          Issue Type: Bug
>    Affects Versions: 1.0.0-M3
>            Reporter: Daniel Fisher
>             Fix For: 1.0.0-M4
>
>
> The LdapNetworkConnection initializes an instance of Felix but never shuts it down. 
> See the thread at: http://mail-archives.apache.org/mod_mbox/directory-api/201105.mbox/thread
> You may also want to review the LdapCodecServiceFactory class for thread safety.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (DIRSHARED-125) Felix not properly shutdown

Posted by "Emmanuel Lecharny (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DIRSHARED-125?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13031253#comment-13031253 ] 

Emmanuel Lecharny commented on DIRSHARED-125:
---------------------------------------------

Ok, after some more investigation, it seems that Felix has one thread which is not a daemon thread, thus it's not killed when you exit from main. There is an opened bug in FELIX for that :
https://issues.apache.org/jira/browse/FELIX-2434?focusedCommentId=13031246#comment-13031246

> Felix not properly shutdown
> ---------------------------
>
>                 Key: DIRSHARED-125
>                 URL: https://issues.apache.org/jira/browse/DIRSHARED-125
>             Project: Directory Shared
>          Issue Type: Bug
>    Affects Versions: 1.0.0-M3
>            Reporter: Daniel Fisher
>             Fix For: 1.0.0-M4
>
>
> The LdapNetworkConnection initializes an instance of Felix but never shuts it down. 
> See the thread at: http://mail-archives.apache.org/mod_mbox/directory-api/201105.mbox/thread
> You may also want to review the LdapCodecServiceFactory class for thread safety.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Resolved] (DIRSHARED-125) Felix not properly shutdown

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

Emmanuel Lecharny resolved DIRSHARED-125.
-----------------------------------------

    Resolution: Fixed

Fixed in trunk with http://svn.apache.org/viewvc?rev=1101926&view=rev


> Felix not properly shutdown
> ---------------------------
>
>                 Key: DIRSHARED-125
>                 URL: https://issues.apache.org/jira/browse/DIRSHARED-125
>             Project: Directory Shared
>          Issue Type: Bug
>    Affects Versions: 1.0.0-M3
>            Reporter: Daniel Fisher
>             Fix For: 1.0.0-M4
>
>
> The LdapNetworkConnection initializes an instance of Felix but never shuts it down. 
> See the thread at: http://mail-archives.apache.org/mod_mbox/directory-api/201105.mbox/thread
> You may also want to review the LdapCodecServiceFactory class for thread safety.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (DIRSHARED-125) Felix not properly shutdown

Posted by "Emmanuel Lecharny (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DIRSHARED-125?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13032112#comment-13032112 ] 

Emmanuel Lecharny commented on DIRSHARED-125:
---------------------------------------------

Actually, it gets cleaned up when the JVM quit, but adding a finalize() offers little garantee that Felix will be properly shutdown in time.

FYI, this issue will most certainly be solved by the removal of Felix from the API : we discussed this on the mailing list and now think that we can avoid using Felix at all.

> Felix not properly shutdown
> ---------------------------
>
>                 Key: DIRSHARED-125
>                 URL: https://issues.apache.org/jira/browse/DIRSHARED-125
>             Project: Directory Shared
>          Issue Type: Bug
>    Affects Versions: 1.0.0-M3
>            Reporter: Daniel Fisher
>             Fix For: 1.0.0-M4
>
>
> The LdapNetworkConnection initializes an instance of Felix but never shuts it down. 
> See the thread at: http://mail-archives.apache.org/mod_mbox/directory-api/201105.mbox/thread
> You may also want to review the LdapCodecServiceFactory class for thread safety.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (DIRSHARED-125) Felix not properly shutdown

Posted by "Emmanuel Lecharny (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DIRSHARED-125?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13031072#comment-13031072 ] 

Emmanuel Lecharny commented on DIRSHARED-125:
---------------------------------------------

As suggested by Dniel :
public class Test
{
  public static void main(String[] args) throws Exception
  {
    LdapNetworkConnection lc = new LdapNetworkConnection();
    // uncomment to fix
    //StandaloneLdapCodecService cs =
    //  (StandaloneLdapCodecService) lc.getCodecService();
    //cs.shutdown();
  }
}

we have to provide some way to shut down Felix properly. It's not convenient to have to explicitly get the StandaloneLdapCodecService instance to do that.



> Felix not properly shutdown
> ---------------------------
>
>                 Key: DIRSHARED-125
>                 URL: https://issues.apache.org/jira/browse/DIRSHARED-125
>             Project: Directory Shared
>          Issue Type: Bug
>    Affects Versions: 1.0.0-M3
>            Reporter: Daniel Fisher
>             Fix For: 1.0.0-M4
>
>
> The LdapNetworkConnection initializes an instance of Felix but never shuts it down. 
> See the thread at: http://mail-archives.apache.org/mod_mbox/directory-api/201105.mbox/thread
> You may also want to review the LdapCodecServiceFactory class for thread safety.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira