[
https://issues.apache.org/jira/browse/JAMES-979?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12840699#action_12840699
]
Emmanuel Lecharny commented on JAMES-979:
-----------------------------------------
Hi from MINA,
you have to understand the way MINA works : when you have a client connecting
to the server, and send a request for, say, the 100 000 messages waiting for
this client (this is just an hypothesis), MINA will try to send all those
messages by creating buffers stored in a write queue. if the socket is swamped,
the buffer will still enqueue, so at some point, with a slow client, you may
perfectly have hundred of thousands messages stored in the write queue waiting
for the socket to be ready.
Of course, if you kill the client, suddenly the server thread trying to write
the messages to the client will fail pathetically, with a lot of verbosity...
How to avoid such a scenario ? Well, it would be great if MINA was smart enough
to determinate that when the client has closed the socket, then all the
messages in the write queue should be discarded (feel free to create a JIRA for
this, we probably could fix that). However, you can still kill the server if
the client is just a slow reader, as the messages will continue to flow
through. In this case, you have to check that the previous message has been
correctly sent before sending the next one.
Now, I tried to have a look at the code, but the twi snippet I got weren't
enough to get a clue about what's exactly is going wild in your case.
> IOException when closing mail client
> ------------------------------------
>
> Key: JAMES-979
> URL: https://issues.apache.org/jira/browse/JAMES-979
> Project: JAMES Server
> Issue Type: Bug
> Components: IMAPServer
> Affects Versions: Trunk
> Environment: Win XP, Thunderbird
> Reporter: Tim-Christian Mundt
> Priority: Critical
> Attachments: jstack_inifinite.log, jstack_short.log
>
>
> Quite often when closing Thunderbird I get this exception:
> ERROR 10:56:01,234 | james.imapserver | Error while processing imap request
> java.io.IOException: Eine vorhandene Verbindung wurde vom Remotehost
> geschlossen *
> at sun.nio.ch.SocketDispatcher.write0(Native Method)
> at sun.nio.ch.SocketDispatcher.write(Unknown Source)
> at sun.nio.ch.IOUtil.writeFromNativeBuffer(Unknown Source)
> at sun.nio.ch.IOUtil.write(Unknown Source)
> at sun.nio.ch.SocketChannelImpl.write(Unknown Source)
> at
> org.apache.mina.transport.socket.nio.NioProcessor.write(NioProcessor.java:208)
> at
> org.apache.mina.transport.socket.nio.NioProcessor.write(NioProcessor.java:42)
> at
> org.apache.mina.core.polling.AbstractPollingIoProcessor.writeBuffer(AbstractPollingIoProcessor.java:834)
> at
> org.apache.mina.core.polling.AbstractPollingIoProcessor.flushNow(AbstractPollingIoProcessor.java:764)
> at
> org.apache.mina.core.polling.AbstractPollingIoProcessor.flush(AbstractPollingIoProcessor.java:692)
> at
> org.apache.mina.core.polling.AbstractPollingIoProcessor.access$500(AbstractPollingIoProcessor.java:61)
> at
> org.apache.mina.core.polling.AbstractPollingIoProcessor$Processor.run(AbstractPollingIoProcessor.java:973)
> at
> org.apache.mina.util.NamePreservingRunnable.run(NamePreservingRunnable.java:64)
> at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown
> Source)
> at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
> at java.lang.Thread.run(Unknown Source)
> I occurs aprx 200 times per second and basically fills up the hard drive with
> those lines in the log files (that's why I set this issue to critical). I've
> no idea how to debug this because I can't see where this is called.
> *) an existing connection has been closed by the remote host
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]