[infinispan-dev] DefaultExecutorFactory and rejection policy

Dan Berindei dan.berindei at gmail.com
Thu Mar 14 05:03:10 EDT 2013


On Thu, Mar 14, 2013 at 9:32 AM, Radim Vansa <rvansa at redhat.com> wrote:

> Blocking OOB threads is the thing we want to avoid, remember?
>

Well, you have to block somewhere...

I like Adrian's solution, because it's a lot better than CallerRunsPolicy:
it's blocking the OOB thread until any other command finishes executing,
not until one particular command finishes executing.


I am used do synchronous replication, there we could hold a semaphore on
> requests to each node. Going down before each RPC and up after that would
> be pretty simple and having this mechanism in RPC layer it would block only
> request, not response messages.


I don't think you can throttle on the sender, because you don't know how
many threads the recipient should allocate per sender in the Infinispan
thread pool.

E.g. in non-tx concurrent mode, for each user-initiated request, the
primary owner sends out numOwners requests to the other nodes. If the cache
is also replicated, you have the coordinator sending clusterSize requests
to the other nodes for each user-initiated request. (So for each request
that a node receives from the coordinator, it will receive exactly 0
requests from the other nodes.)

If you start considering that each cache should have its own semaphore,
because they need different numbers of threads, then finding an appropriate
initial value is pretty much impossible.


Are there any shoot & forget messages sent from Infinispan which could not
> be applied in this way?
> Regarding the async replication, I am not sure whether the request is just
> processed in non-caller thrad or if there is anything more.
>
>
Async messages require ordering most of the time, so they're handled on the
Incoming thread pool directly and they're not passed to the Infinispan
thread pool (at least for now).



> Radim
>
> ----- Original Message -----
> | From: "Adrian Nistor" <anistor at redhat.com>
> | To: "infinispan -Dev List" <infinispan-dev at lists.jboss.org>
> | Sent: Wednesday, March 13, 2013 3:37:23 PM
> | Subject: Re: [infinispan-dev] DefaultExecutorFactory and rejection policy
> |
> | What about creating a RejectedExecutionHandler that blocks the
> | calling
> | thread if the thread pool has reached the max (and all threads are
> | busy)
> | and the associated queue is also full? See
> | org.hibernate.search.batchindexing.impl.Executors.BlockPolicy
> |
> | Some time ago I was thinking we need this for infinispan's thread
> | pools
> | too because of some very insidious test suite failures caused by
> | dropped
> | tasks and created ISPN-2438 but never got to experiment with this.
> | The
> | solution used for the moment was to increase the pool a bit for unit
> | tests...
> |
> | Cheers
> |
> | On 03/13/2013 04:18 PM, Pedro Ruivo wrote:
> | > By default, the thread pools are bounded and we have nothing to
> | > prevent
> | > the it to be full.
> | >
> | > currently, the regular message are not processed by the thread
> | > pool.
> | > this can be solved when a smarter dispatcher/ordering mechanism is
> | > implemented.
> | >
> | > On 03/13/2013 02:07 PM, Bela Ban wrote:
> | >> You mean an unbounded queue ? This would be bad if the insertion
> | >> rate of
> | >> messages is higher than the processing rate.
> | >>
> | >> The problem with the Infinispan pool is that we cannot simply
> | >> discard
> | >> messages; they won't get retransmitted, as they're been delivered
> | >> by
> | >> JGroups.
> | >>
> | >> If we end up with our own ordering of messages in the ISPN pool,
> | >> then a
> | >> rejection policy of "run" would also cause harm, as it would
> | >> destroy the
> | >> ordering (except for OOB messages)...
> | >>
> | >> On 3/13/13 2:52 PM, Erik Salter wrote:
> | >>> Any reason the messages can't be queued?   In my mind, the
> | >>> benefits would
> | >>> outweigh the unbounded nature of it.
> | >>>
> | >>> Erik
> | >>>
> | >>> -----Original Message-----
> | >>> From: infinispan-dev-bounces at lists.jboss.org
> | >>> [mailto:infinispan-dev-bounces at lists.jboss.org] On Behalf Of
> | >>> Pedro Ruivo
> | >>> Sent: Wednesday, March 13, 2013 9:29 AM
> | >>> To: ispn-dev
> | >>> Subject: [infinispan-dev] DefaultExecutorFactory and rejection
> | >>> policy
> | >>>
> | >>> Hi
> | >>>
> | >>> I'm working on ISPN-2808
> | >>> (https://issues.jboss.org/browse/ISPN-2808) and I
> | >>> noticed that the DefaultExecutorFactory is creating the executor
> | >>> service
> | >>> with an Abortpolicy.
> | >>>
> | >>> Is there any particular reason for that?
> | >>>
> | >>> In the new thread pool needed by ISPN-2808, I cannot have the
> | >>> messages (i.e.
> | >>> the runnables) discarded, because it can cause some inconsistent
> | >>> state and
> | >>> even block all the cluster.
> | >>>
> | >>> I have set in my branch a CallerRunPolicy. If you see any issue
> | >>> with this
> | >>> let me know.
> | >>>
> | >>> Cheers,
> | >>> Pedro
> | >>
> | > _______________________________________________
> | > infinispan-dev mailing list
> | > infinispan-dev at lists.jboss.org
> | > https://lists.jboss.org/mailman/listinfo/infinispan-dev
> |
> | _______________________________________________
> | infinispan-dev mailing list
> | infinispan-dev at lists.jboss.org
> | https://lists.jboss.org/mailman/listinfo/infinispan-dev
> |
> _______________________________________________
> infinispan-dev mailing list
> infinispan-dev at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/infinispan-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/infinispan-dev/attachments/20130314/29d79e8e/attachment.html 


More information about the infinispan-dev mailing list