[jboss-cvs] JBoss Messaging SVN: r4259 - in trunk/src: main/org/jboss/messaging/core/remoting/impl/mina and 1 other directory.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Wed May 21 05:22:38 EDT 2008
Author: jmesnil
Date: 2008-05-21 05:22:37 -0400 (Wed, 21 May 2008)
New Revision: 4259
Modified:
trunk/src/config/jbm-configuration.xml
trunk/src/main/org/jboss/messaging/core/remoting/impl/mina/MinaConnector.java
trunk/src/main/org/jboss/messaging/core/remoting/impl/mina/MinaHandler.java
trunk/src/main/org/jboss/messaging/core/remoting/impl/mina/MinaService.java
Log:
* in MinaHandler, removed bogus IO thread detection and suspend/resume code
* the TCP No Delay value is picked from jbm-configuration.xml (true by default)
Modified: trunk/src/config/jbm-configuration.xml
===================================================================
--- trunk/src/config/jbm-configuration.xml 2008-05-21 08:32:13 UTC (rev 4258)
+++ trunk/src/config/jbm-configuration.xml 2008-05-21 09:22:37 UTC (rev 4259)
@@ -30,7 +30,7 @@
<!-- Enable/Disable Nagle's Algorithm (resp. true/false) -->
<!-- This setting is taken into account only when remoting-transport is set to TCP -->
- <remoting-tcp-nodelay>false</remoting-tcp-nodelay>
+ <remoting-tcp-nodelay>true</remoting-tcp-nodelay>
<!-- Set the TCP Receive Buffer size (SO_RCVBUF). -->
<!-- Set it to -1 if you want to use the value hinted by the Operating System -->
Modified: trunk/src/main/org/jboss/messaging/core/remoting/impl/mina/MinaConnector.java
===================================================================
--- trunk/src/main/org/jboss/messaging/core/remoting/impl/mina/MinaConnector.java 2008-05-21 08:32:13 UTC (rev 4258)
+++ trunk/src/main/org/jboss/messaging/core/remoting/impl/mina/MinaConnector.java 2008-05-21 09:22:37 UTC (rev 4259)
@@ -135,7 +135,6 @@
}
connector.getSessionConfig().setKeepAlive(true);
connector.getSessionConfig().setReuseAddress(true);
- connector.getSessionConfig().setTcpNoDelay(true);
}
// NIOConnector implementation -----------------------------------
Modified: trunk/src/main/org/jboss/messaging/core/remoting/impl/mina/MinaHandler.java
===================================================================
--- trunk/src/main/org/jboss/messaging/core/remoting/impl/mina/MinaHandler.java 2008-05-21 08:32:13 UTC (rev 4258)
+++ trunk/src/main/org/jboss/messaging/core/remoting/impl/mina/MinaHandler.java 2008-05-21 09:22:37 UTC (rev 4259)
@@ -193,11 +193,6 @@
{
session.setAttribute(BLOCKED, Boolean.FALSE);
- // Resume read operation if it's suspended.
- if (!session.getTrafficMask().isReadable()) {
- session.resumeRead();
- }
-
//Note that we need to notify all since there may be more than one thread waiting on this
//E.g. the response from a blocking acknowledge and a delivery
notifyAll();
@@ -250,38 +245,19 @@
{
PacketReturner returner;
- final Thread ioThread = Thread.currentThread();
-
if (packet.getResponseTargetID() != Packet.NO_ID_SET)
{
returner = new PacketReturner()
{
public void send(Packet p) throws Exception
{
- // Make sure we don't block the I/O thread.
- if (Thread.currentThread() != ioThread)
+ try
{
- try
- {
- checkWrite(session);
- }
- catch (Exception e)
- {
- log.error("Failed to acquire sem", e);
- }
+ checkWrite(session);
}
- else
+ catch (Exception e)
{
- // If we are running this in the I/O thread, we should not block, because
- // blocking will prevent the decrement of the scheduledWriteBytes() property.
- // Instead, we should disable the read operation temporarily so we don't
- // need to handle incoming messages which causes write queue overflow.
-
- if (session.getScheduledWriteBytes() >= bytesHigh)
- {
- // Will resume on messageSent()
- session.suspendRead();
- }
+ log.error("Failed to acquire sem", e);
}
dispatcher.callFilters(p);
Modified: trunk/src/main/org/jboss/messaging/core/remoting/impl/mina/MinaService.java
===================================================================
--- trunk/src/main/org/jboss/messaging/core/remoting/impl/mina/MinaService.java 2008-05-21 08:32:13 UTC (rev 4258)
+++ trunk/src/main/org/jboss/messaging/core/remoting/impl/mina/MinaService.java 2008-05-21 09:22:37 UTC (rev 4259)
@@ -159,7 +159,6 @@
acceptor.setReuseAddress(true);
acceptor.getSessionConfig().setReuseAddress(true);
acceptor.getSessionConfig().setKeepAlive(true);
- acceptor.getSessionConfig().setTcpNoDelay(true);
acceptor.setCloseOnDeactivation(false);
threadPool = Executors.newCachedThreadPool();
More information about the jboss-cvs-commits
mailing list