[ 
https://issues.apache.org/jira/browse/DIRMINA-1012?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14572655#comment-14572655
 ] 

Marat Gainullin commented on DIRMINA-1012:
------------------------------------------

Really, encrypting/decrypting after initial handshake is not problematic, but 
overhead is overhead.
We have no bottleneck yet, but we had a similar bottleneck in our Thin 
Architecture Server in GPS tracking system build on top of MINA (working with 
about 150 parallel connections). There is no SslFilter. And when we moved 
ExecutorFilter on top of the filter chain, bottleneck went away.
SslFilter bugs have such symptoms: sometimes we get an error "handshake 
failed", sometimes we get nothing and sometimes we get an error about mina 
buffer (IllegalArgumentException) in the following code, while buf.position() 
call:         
{code}
            if (isInboundDone()) {
            // Rewind the MINA buffer if not all data is processed and inbound
            // is finished.
            int inNetBufferPosition = inNetBuffer == null ? 0 : 
inNetBuffer.position();
            buf.position(buf.position() - inNetBufferPosition);

            if (inNetBuffer != null) {
                inNetBuffer.free();
                inNetBuffer = null;
            }
        }
{code}

> SSLFilter does not work in combination with ExecutorFilter
> ----------------------------------------------------------
>
>                 Key: DIRMINA-1012
>                 URL: https://issues.apache.org/jira/browse/DIRMINA-1012
>             Project: MINA
>          Issue Type: Bug
>          Components: Filter, SSL
>    Affects Versions: 2.0.9
>         Environment: Windows 7 x32
> Java(TM) SE Runtime Environment (build 1.8.0_45-b14)
> Java HotSpot(TM) Client VM (build 25.45-b02, mixed mode, sharing)
>            Reporter: Marat Gainullin
>
> If i include SslFilter after the ExecutorFilter in acceptor filter chain, 
> than SslFilter works unstable. It works sometimes and sometimes it doesn't 
> work. It is likely because of multithreaded environment.
> If I move it on top of the filter chain, it works fine.
> Here is buggy filter chain:
> {code}
>         final IoAcceptor acceptor = new NioSocketAcceptor(executor/*Some 
> outer thread pool*/, new NioProcessor(ioProcessorExecutor/*thread pool with 
> only one thread (nio events waiter)*/));
>         acceptor.getFilterChain().addLast("executor", new 
> ExecutorFilter(executor, IoEventType.EXCEPTION_CAUGHT,
>                 IoEventType.MESSAGE_RECEIVED, IoEventType.MESSAGE_SENT, 
> IoEventType.SESSION_CLOSED));
>         acceptor.getFilterChain().addLast("encryption", sslFilter);
>         acceptor.getFilterChain().addLast("platypusCodec", new 
> ProtocolCodecFilter(new ResponseEncoder(), new RequestDecoder()));
>         PlatypusRequestsHandler handler = new PlatypusRequestsHandler(this);
>         acceptor.setHandler(handler);
> {code}
> I think that SslFilter have to work properly in multithreaded environment, 
> but it doesn't.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to