<div dir="ltr"><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Mar 14, 2013 at 9:32 AM, Radim Vansa <span dir="ltr">&lt;<a href="mailto:rvansa@redhat.com" target="_blank">rvansa@redhat.com</a>&gt;</span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Blocking OOB threads is the thing we want to avoid, remember?<br></blockquote><div><br></div><div>Well, you have to block somewhere...<br>

<br>I like Adrian&#39;s solution, because it&#39;s a lot better than CallerRunsPolicy: it&#39;s blocking the OOB thread until any other command finishes executing, not until one particular command finishes executing.<br>
<br>
<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
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. </blockquote>

<div><br></div><div>I don&#39;t think you can throttle on the sender, because you don&#39;t know how many threads the recipient should allocate per sender in the Infinispan thread pool. <br><br>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.)<br>

<br></div><div>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.<br><br></div><div>

<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Are there any shoot &amp; forget messages sent from Infinispan which could not be applied in this way?<br>


Regarding the async replication, I am not sure whether the request is just processed in non-caller thrad or if there is anything more.<br>
<span class=""><font color="#888888"><br></font></span></blockquote><div><br></div><div>Async messages require ordering most of the time, so they&#39;re handled on the Incoming thread pool directly and they&#39;re not passed to the Infinispan thread pool (at least for now).<br>

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