[
https://issues.apache.org/jira/browse/DIRMINA-1142?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17346927#comment-17346927
]
Jonathan Valliere commented on DIRMINA-1142:
--------------------------------------------
Fragmentation on the receive side would be an issue. Adding a thread pool
before the protocol filter would create chaos for trying to serial reconstruct
fragmented messages. The ProtocolCodec core API should be stateless but it is
not. The use of the EncoderOutput object makes it not stateless as messages
are enqueued there and flushed in aggregate after.
I had to fully remove the WriteRequest object reuse code in order to fix the
bug discussed above. Now, it will create a new EncodedWriteRequest object from
every output object in order to prevent multiple threads from trying to detect
the end of the session-local EncodeOutput queue. The easiest thing might be to
make the EncodeOutput TLS and attached to the Session. That way the
EncodeOutput can be reused as well as the WriteRequest leading to zero
performance degradation between single and multi-thread support.
> Missing messages when sending asynchronously
> --------------------------------------------
>
> Key: DIRMINA-1142
> URL: https://issues.apache.org/jira/browse/DIRMINA-1142
> Project: MINA
> Issue Type: Bug
> Components: Core
> Affects Versions: 2.1.3, 2.1.4
> Environment: Linux
> Reporter: Maxime Leur
> Assignee: Jonathan Valliere
> Priority: Critical
> Fix For: 2.1.5
>
> Attachments: ClientServerTest.java
>
>
> I found an issue on 2.1.x branch when a client is sending messages
> asynchronously.
> I create a simple client and a server with a simple
> ObjectSerializationCodecFactory.
> On a client, I send simple String messages (e.g. Message:1) inside a thread
> pool (size=2).
> Then I check:
> * On client, I check that I send all these messages and avoid duplicate.
> * On server, I check that I receive all these messages.
> If client send "1000" messages on thread pool with 2 threads, server will
> miss 11messages:
> {noformat}
> 12:24:59,573 INFO <main> missingMessageTest.begin with 1000 messages and 2
> threads
> 12:24:59,577 INFO <main> missingMessageTest.end
> 12:24:59,577 INFO <main> missingMessageTest.sleep... 1000
> 12:24:59,580 ERROR <NioProcessor-14> messageSent: message <Message:21>
> already sent
> 12:24:59,581 ERROR <NioProcessor-14> messageSent: message <Message:27>
> already sent
> 12:24:59,584 ERROR <NioProcessor-14> messageSent: message <Message:113>
> already sent
> 12:24:59,587 ERROR <NioProcessor-14> messageSent: message <Message:164>
> already sent
> 12:24:59,592 ERROR <NioProcessor-14> messageSent: message <Message:313>
> already sent
> 12:24:59,596 ERROR <NioProcessor-14> messageSent: message <Message:386>
> already sent
> 12:24:59,604 ERROR <NioProcessor-14> messageSent: message <Message:567>
> already sent
> 12:24:59,605 ERROR <NioProcessor-14> messageSent: message <Message:615>
> already sent
> 12:24:59,606 ERROR <NioProcessor-14> messageSent: message <Message:628>
> already sent
> 12:24:59,611 ERROR <NioProcessor-14> messageSent: message <Message:760>
> already sent
> 12:24:59,612 ERROR <NioProcessor-14> messageSent: message <Message:822>
> already sent
> 12:25:00,578 INFO <main> missingMessageTest.sleep... 2000
> 12:25:01,578 INFO <main> missingMessageTest.sleep... 3000
> 12:25:02,579 INFO <main> missingMessageTest.sleep... 4000
> 12:25:03,579 INFO <main> missingMessageTest.sleep... 5000
> 12:25:04,579 INFO <main> missingMessageTest.close
> 12:25:04,582 ERROR <main> missing <11> messages : [Message:760, Message:27,
> Message:21, Message:313, Message:567, Message:822, Message:615, Message:628,
> Message:386, Message:113, Message:164]
> {noformat}
> I works fine with one thread (e.g. synchronous send).
> This junit works with "Apache Mina" "2.0.21", it failed with "2.1.x" branch.
> I attach my junit to reproduce this issue on your side.
>
>
--
This message was sent by Atlassian Jira
(v8.3.4#803005)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]