Hi Martin,

Apologies for the late response....

On 9/18/07, Martin Alderson <[EMAIL PROTECTED]> wrote:
> Hi all,
>
> I don't know too much about Mina so forgive me if I say anything stupid!
>
> I have hit a problem with my own hacked about version of ApacheDS.  ApacheDS 
> is an LDAP server which uses Mina 1.1.2 for its replication service.
>
> The problem I am experiencing is that I have a replication (write) scheduled 
> to occur every 60 seconds, and occasionally when this occurs I will 
> immediately get a WriteTimeoutException.  I understand the default write 
> timeout is also 60 seconds.  The strange thing is the two servers are running 
> on the same machine and looking at the logs it seems that all previous 
> messages were sent.
>
> I am wondering if it is possible that when my new write is attempted the 
> timeout is checked at the same time - so Mina thinks there is a write pending 
> and sees that the last message was sent more than 60 seconds ago (which would 
> be possible depending on the thread timing!)
>
> Has anyone experienced something like this before?  Does this sound like a 
> possible scenario?

I think it can happen, but it shouldn't happen.  Whenever something is
written, lastWriteTime is updated automatically, and
WriteTimeoutException is raised only when lastWriteTime has not been
updated for a certain amount of time.  Looking into
SocketIoProcessor.java, it attempts to write first (i.e. doFlush())
and then check timeout (i.e. notifyIdleness()).  Are you sure the
caught WriteTimeoutException is for the successfully written message?
Any simplified test case would be appreciated.

Thanks,
Trustin
-- 
what we call human nature is actually human habit
--
http://gleamynode.net/
--
PGP Key ID: 0x0255ECA6

Reply via email to