On Thu, Jul 30, 2009 at 3:53 PM, Emmanuel Lecharny<[email protected]> wrote:
> Adam Brown wrote:
>>
>> i'm currently using a FileRegionWriteFilter 'before' an SslFilter to
>> breakup FileRegion objects into chunks that SslFilter can handle
>> (since SslFilter doesn't handle them directly).  however, this filter
>> chain also has IoBuffers written to the same IoSession.
>>
>> the problem i'm seeing appears to be that the IoBuffer is not being
>> sent by MINA (with messageSent() being sent back up the chain and
>> IoHandler) before the first IoBuffer generated by the
>> FileRegionWriteFilter is written.  because of this ordering, my
>> IoBuffer (not the ones created by FileRegionWriteFilter) is "lost" to
>> the chain and never has messageSent() called on it.  in addition to
>> the messageSent() call made with the FileRegion, some of the IoBuffers
>> generated by FileRegionWriteFilter "escape" and have messageSent()
>> called on them, passing them up the filter chain (and ultimately to my
>> IoHandler).
>>
>> so really, i've got two problems :-).
>>
>
> Are you using an ExecutorFilter? If so, which kind of threadPool are you
> using ?

no, we are not using an ExecutorFilter on the filter chain.  all of
the write()s are occuring in the same thread, just different places in
our code.

>
> Can you push a very simple piece of code demonstrating the problem so that
> we can debu it and understand what's going on ?

yeah, i'll try to put together a simple example that exercises this.
i did a little debugging before posting to the list & the general flow
of events is as follows:

our code:
ioSession.write(myIoBuffer);
...
ioSession.write(fileRegion);

yields in the filter chain:

AbstractStreamWriteFilter.filterWrite(myIoBuffer);
AbstractStreamWriteFilter.filterWrite(fileRegion);
AbstractStreamWriteFilter.messageSent(myIoBuffer);  -> gets "captured"
by AbstractStreamWriteFilter
AbstractStreamWriteFilter.messageSent(ioBufferForFileRegion);  ->
called a couple of times
...
=> nextFilter.messageSent(fileRegion);
nextFilter.messageSent(ioBufferForFileRegion);  -> called at least
once, but this should have been "captured" by
AbstractStreamWriteFilter

>
> Thanks !
>
> PS: MINA version, etc... That helps !

right now, we're using 2.0.0-M3.  we had switched to -M5 a while back,
but there was a serious performance drop-off caused by -M5 (which we
haven't had a chance to track down yet), so we reverted to -M3.

>
> --
> --
> cordialement, regards,
> Emmanuel Lécharny
> www.iktek.com
> directory.apache.org
>
>
>

Reply via email to