reef-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andrew Chung <afchun...@gmail.com>
Subject Re: Test failure in master
Date Wed, 18 May 2016 18:03:48 GMT
Hi Markus,

Yes, however, note that the documentation[0] mentions that
`getActiveCount()` returns the *approximate* number of threads that are
active. It seems that there are people that have already run into trouble
with using it[1].
To solve this, I'm using `getInMeter().getCount() -
getOutMeter().getCount()` in `ThreadPoolStage` instead, and putting
`afterOnNext` into the `finally` block in the `run` method of
`executor.submit`.

Thanks,
Andrew

[0]:
http://docs.oracle.com/javase/7/docs/api/java/util/concurrent/ThreadPoolExecutor.html#getActiveCount%28%29
[1]:
http://stackoverflow.com/questions/7271541/threadpoolexecutors-getactivecount/7271685

On Wed, May 18, 2016 at 10:38 AM, Markus Weimer <markus@weimo.de> wrote:

> Hi,
>
> our idless check boils down to checking whether or not any thread in
> `org.apache.reef.wake.impl.ThreadPoolStage` is still active. That calses is
> based on a `ThreadPoolExecutor`, which has a convenient method
> `.getActiveCount()`. Maybe we need to expose that method in some elegant
> way?
>
> Markus
>

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