reef-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sergiy Matusevych <sergiy.matusev...@gmail.com>
Subject Re: Question on returning AutoCloseable in RemoteManager.registerHandler()
Date Sat, 17 Feb 2018 02:12:51 GMT
Hi Chenxi,

That's a good question - please give me some time to look at the code and
I'll try to give you an answer. Making things AutoCloseable in REEF was
pretty much as an afterthought - we never bothered to delete things when we
controlled the whole JVM process; we do need to clean up when REEF
application is being run as part of another app (say, Spark).

In general, we now try to make all REEF objects AutoCloseable, and also
make sure that the .close() method 1) is idempotent (i.e. second call to it
is a no-op), and 2) never throws (i.e. handles errors and logs them
internally).

I'll look at that particular case soon and let you know.

Cheers,
Sergiy.


On Wed, Feb 7, 2018 at 10:36 AM, Chenxi Zhao <
Chenxi.Zhao@microsoft.com.invalid> wrote:

> Hi,
>
> I noticed that RemoteManager.registerHandler is returning AutoCloseable
> Interface, which is actually created by
>
> https://github.com/apache/reef/blob/master/lang/java/
> reef-wake/wake/src/main/java/org/apache/reef/wake/remote/
> impl/HandlerContainer.java#L94
>
> There is no try  {} block to call the close() Interface in RemoteManager.
> But in some of the callers, they don't actually explicitly call close() as
> it is AutoCloseable.
>
> e.g.
> https://github.com/apache/reef/blob/master/lang/java/
> reef-common/src/main/java/org/apache/reef/runtime/common/
> driver/client/ClientManager.java#L81
> https://github.com/apache/reef/blob/master/lang/java/
> reef-runtime-local/src/main/java/org/apache/reef/runtime/
> local/driver/ContainerManager.java#L127
>
> Correct my understanding if I miss some code -
>
> My questions here are:
>
>
>   1.  For above two links, it seems to be buggy as they don't call close().
>   2.  Why is reef choosing AutoCloseable over Closeable here? I could not
> see the benefit using AutoCloseable but got some confusion.
>
> Thanks,
> Chenxi
>
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message