From 5ad86fc8a8f6389201fa53ace6e3097572157f78 Mon Sep 17 00:00:00 2001 From: Greg Wilkins Date: Mon, 15 Jun 2009 23:42:35 +0000 Subject: [PATCH] chasing the race bug git-svn-id: svn+ssh://dev.eclipse.org/svnroot/rt/org.eclipse.jetty/jetty/trunk@398 7e9141cc-0065-0410-87d8-b60c137991c4 --- .../eclipse/jetty/server/HttpConnection.java | 1 + .../org/eclipse/jetty/server/StressTest.java | 51 ++----------------- .../java/org/eclipse/jetty/util/log/Log.java | 2 +- 3 files changed, 7 insertions(+), 47 deletions(-) diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/HttpConnection.java b/jetty-server/src/main/java/org/eclipse/jetty/server/HttpConnection.java index c728875268e..111306c98f2 100644 --- a/jetty-server/src/main/java/org/eclipse/jetty/server/HttpConnection.java +++ b/jetty-server/src/main/java/org/eclipse/jetty/server/HttpConnection.java @@ -385,6 +385,7 @@ public class HttpConnection implements Connection try { _handling=true; + assert getCurrentConnection()==null; setCurrentConnection(this); while (more_in_buffer) diff --git a/jetty-server/src/test/java/org/eclipse/jetty/server/StressTest.java b/jetty-server/src/test/java/org/eclipse/jetty/server/StressTest.java index bfb73b81157..b264c8273fc 100644 --- a/jetty-server/src/test/java/org/eclipse/jetty/server/StressTest.java +++ b/jetty-server/src/test/java/org/eclipse/jetty/server/StressTest.java @@ -64,10 +64,10 @@ public class StressTest extends TestCase _threads.setMaxThreads(500); _server.setThreadPool(_threads); SelectChannelConnector c_connector=new SelectChannelConnector(); - c_connector.setAcceptors(4); + c_connector.setAcceptors(1); c_connector.setAcceptQueueSize(1000); - //c_connector.setPort(8080); + // c_connector.setPort(8080); _connector=c_connector; _connector.setMaxIdleTime(30000); @@ -77,8 +77,8 @@ public class StressTest extends TestCase _server.start(); _port=_connector.getLocalPort(); _addr=Inet4Address.getLocalHost(); - //_addr=Inet4Address.getByName("10.10.1.16"); - System.err.println("ADDR "+_addr+":"+_port); + // _addr=Inet4Address.getByName("10.10.1.16"); + // System.err.println("ADDR "+_addr+":"+_port); for (Queue q:_latencies) q.clear(); @@ -397,50 +397,9 @@ public class StressTest extends TestCase doThreads(200,400,true); } else - doThreads(50,100,true); + doThreads(100,100,true); } - /* - public void testNonPersistent0() throws Throwable - { - testNonPersistent(); - } - - public void testPersistent0() throws Throwable - { - testPersistent(); - } - - public void testNonPersistent1() throws Throwable - { - testNonPersistent(); - } - - public void testPersistent1() throws Throwable - { - testPersistent(); - } - - public void testNonPersistent2() throws Throwable - { - testNonPersistent(); - } - - public void testPersistent2() throws Throwable - { - testPersistent(); - } - - public void testNonPersistent3() throws Throwable - { - testNonPersistent(); - } - - public void testPersistent3() throws Throwable - { - testPersistent(); - } - */ private int count(String s,String sub) diff --git a/jetty-util/src/main/java/org/eclipse/jetty/util/log/Log.java b/jetty-util/src/main/java/org/eclipse/jetty/util/log/Log.java index e594ad92834..775fcd54a15 100644 --- a/jetty-util/src/main/java/org/eclipse/jetty/util/log/Log.java +++ b/jetty-util/src/main/java/org/eclipse/jetty/util/log/Log.java @@ -57,7 +57,7 @@ public class Log public Boolean run() { __logClass = System.getProperty("org.eclipse.jetty.util.log.class","org.eclipse.jetty.util.log.Slf4jLog"); - __ignored = System.getProperty("org.eclipse.jetty.util.log.IGNORED",null)!=null; + __ignored = Boolean.parseBoolean(System.getProperty("org.eclipse.jetty.util.log.IGNORED","false")); return true; } });