On Thu, Dec 18, 2008 at 5:02 AM, 罗志达 <[email protected]> wrote:
> Hi mina developers,
>
> This is Daniel from Multi-Thread Run-time Analysis Tool for Java team.
> Link: http://www.alphaworks.ibm.com/tech/mtrat
>
> We run ftpserver-1.0.0-M4 with our tool and one user login to the server,
> then a data race is reported. The data race  happens in the field
> "readMessages" of class
> "org/apache/mina/transport/socket/nio/NioSocketSession". Thread
> "pool-3-thread-1" read this field while thread "pool-2-thread-1" write to
> it, which both threads don't share the same lock to protect the critical
> section. We got some similar data races reported by our tool and we can post
> it if necessary.

I believe there were some discussions on these fields some time back,
but it seems it was never resolved (or my memory is failing me). The
discussion resolved around if they should be made violative, use
AtomicInteger or if we should synchronize. Maybe it's time to re-open
the discussion.

I think we need to synchronize a bunch of the methods in
AbstractIoSession, for example increaseReadMessages(). It updates a
bunch of fields which would be inconsistent in the current design.

/niklas

Reply via email to