You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@mina.apache.org by "Mauritz Lovgren (JIRA)" <ji...@apache.org> on 2008/12/27 03:37:44 UTC
[jira] Updated: (DIRMINA-653) IoSession.write not thread-safe?
Loosing messages under heavy multi-threaded write on same session.
[ https://issues.apache.org/jira/browse/DIRMINA-653?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Mauritz Lovgren updated DIRMINA-653:
------------------------------------
Description:
I am writing a stress-test that tests multi-thread safetyness of our stateless encoder / decoder under heavy load and I am observing that messages are silently lost during session.write(Object), (the lost messages do not seem to reach the underlying socket buffer at all).
I am using one encoder / decoder that is stateless. No executor filter, only the filter codec and a basic io handler.
Synchronizing on the session.write makes the problem go away;
synchronized (session)
{
future = session.write(message);
}
Do I really have to synchronize on the session to solve this issue?
was:
I am writing a stress-test that tests multi-thread safetyness of our stateless encoder / decoder under heavy load and I am observing that messages are silently lost during session.write(Object), (the lost messages does not seem to reach the underlying socket buffer at all).
I am using one encoder / decoder that is stateless. No executor filter, only the filter codec and a basic io handler.
Putting a synchronized around the session.write makes the problem go away;
synchronized (session)
{
future = session.write(message);
}
Do I really have to synchronize on the session to solve this issue?
> IoSession.write not thread-safe? Loosing messages under heavy multi-threaded write on same session.
> ---------------------------------------------------------------------------------------------------
>
> Key: DIRMINA-653
> URL: https://issues.apache.org/jira/browse/DIRMINA-653
> Project: MINA
> Issue Type: Bug
> Components: Core, Filter
> Affects Versions: 2.0.0-M4
> Environment: Windows Vista 64-bit
> Reporter: Mauritz Lovgren
>
> I am writing a stress-test that tests multi-thread safetyness of our stateless encoder / decoder under heavy load and I am observing that messages are silently lost during session.write(Object), (the lost messages do not seem to reach the underlying socket buffer at all).
> I am using one encoder / decoder that is stateless. No executor filter, only the filter codec and a basic io handler.
> Synchronizing on the session.write makes the problem go away;
> synchronized (session)
> {
> future = session.write(message);
> }
> Do I really have to synchronize on the session to solve this issue?
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.