Hello,
I've noticed the forum post about the RejectedExecutionException
experienced under load [1]. In Hibernate Search we had a similar issue
where the producers where quicker than the consumption of tasks; while
I agree about defining a larger queue it's still possible to
experience the error.
What we did there is to customize the ThreadPool factory to have the
caller block waiting for space in the queue when it's full [2].
This seems to me a sane approach, not sure why there's no such policy
by default in j.u.concurrent. am I missing something obvious? or
should we use the same strategy in Infinispan?
Of course you might still want to recommend a larger queue, but at
least it behaves safely in the remaining extreme cases.
See the BlockPolicy in link [2], it was not hard to implement even
while j.u.c doesn't ship such a policy.
[1] -
http://community.jboss.org/thread/152661
[2] -
http://anonsvn.jboss.org/repos/hibernate/search/trunk/hibernate-search/sr...
Regards,
Sanne