[ 
https://issues.apache.org/jira/browse/ARIES-2120?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17766248#comment-17766248
 ] 

Amichai Rothman commented on ARIES-2120:
----------------------------------------

btw from a quick glance (I may be wrong) it seems the TCPProvider works around 
this issue by being very inefficient with its resources, opening and closing a 
socket for every single method invocation, and the FastBinProvider seems to use 
the bundle activator to close its resources however this pattern leaves 
resources open (and possibly leaking more with time) during the entire runtime 
of the bundle until it is finally stopped, and may not be appropriate for other 
providers (and maybe also this one). I think there should be a better solution 
built in to the DistributionProvider design.

> Imported service proxy cannot be properly closed (potential leak)
> -----------------------------------------------------------------
>
>                 Key: ARIES-2120
>                 URL: https://issues.apache.org/jira/browse/ARIES-2120
>             Project: Aries
>          Issue Type: Bug
>          Components: Remote Service Admin
>    Affects Versions: rsa-1.16.1
>            Reporter: Amichai Rothman
>            Priority: Major
>
> The main DistributionProvider interface contains two methods, 
> exportService and importEndpoint. The former returns an Endpoint which is an 
> inteface that extends Closeable, and thus can later be closed by RSA as 
> necessary. However, importEndpoint returns the actual proxy instance itself - 
> it is created and returned and passed transparently to the caller.
>  
> The proxy implementation would likely require opening some reasources like 
> network sockets etc. in order to do the remote invocation, however in the 
> current design there is no lifecycle management, specifically no way to 
> properly close the proxy and its backing resources.
>  
> Having the returned proxy itself implement Closeable would be problematic, 
> since the exported/imported interface may have its own close() method 
> (invoked remotely) which we do not want to hide. Perhaps, like with the 
> exports, the returned object should not be the proxy itself but a wrapper 
> class that contains the proxy but is also Closeable or contains some other 
> form of lifecycle management, so it can be called by RSA when the proxy and 
> its resources should be disposed of. Perhaps there are other, better ways of 
> doing this, but they DistributionProvider interface may have to change in any 
> case.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to