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

Emmanuel Lécharny commented on DIRMINA-1142:
--------------------------------------------

Clearly using TLS would avoid some of the problem we have, but objects stored 
in the TLS will be shared across the sessions, too, so that mean you will have 
to keep a map of sessions in the TLS.

In any case, when dealing with fragmentation (ie when you have to wait for more 
data to process the decoding), you have to store something in the session 
anyway. This is why I suggest to have a decoder instance per session as it may 
store those data and will be GCed when the session dies.

All in all, if the encoders/decoders are well written, ie stateless, we should 
be safe. That means they have to deal with the storage of partial data in the 
session object.

> 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]

Reply via email to