Hi Jonathan,
it's probably better to put your comment in the JIRA ticket, for a
better follow up...
That being said,
Le 06/10/2017 à 20:08, Jonathan Valliere a écrit :
> I haven’t looked at the Mina code in a while. Looking at
> DefaultIoFilterChain.java under HeadFilter#filterWrite
>
> WriteRequestQueue writeRequestQueue = s.getWriteRequestQueue();
>
> if (!s.isWriteSuspended()) {
> if (writeRequestQueue.isEmpty(session)) {
> // We can write directly the message
> s.getProcessor().write(s, writeRequest);
> } else {
> s.getWriteRequestQueue().offer(s, writeRequest);
> s.getProcessor().flush(s);
> }
> } else {
> s.getWriteRequestQueue().offer(s, writeRequest);
> }
>
> Checking and working with the WriteRequestQueue is unnecessary because the
> AbstractPollingIoProcessor adds all write requests to the Queue anyway.
Those are two different queues. The HeadFilter stacks the message in a
session queue, while the AbstractPollingIoProcessor stacks the message
in the IoProcessor queue. You may have thousands of sessions but nly a
few IoProcessor which handle many sessions.
>
> Similarly, it is confusing that the HeadFilter is controlling the
> increaseScheduledWriteBytes. This should be controlled by the
> AbstractPollingIoProcessor to ensure safety of the increase/decrease
> operations.
Again, this is a per session counter vs a per IoProcessor counter. The
application is really interested on what happens on ifself.
--
Emmanuel Lecharny
Symas.com
directory.apache.org