Re: Bug in xmlrpc-3.0b1
On 8/2/06, Stanislav Miklik <[EMAIL PROTECTED]> wrote: Current code is: } *catch* (BindException e) { *if* (i == 10) { * throw* e; Throwing the exception here will leave the circle. Jochen -- My wife Mary and I have been married for forty-seven years and not once have we had an argument serious enough to consider divorce; murder, yes, but divorce, never. (Jack Benny) - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
svn commit: r428030 - in /webservices/xmlrpc/trunk: server/src/main/java/org/apache/xmlrpc/webserver/WebServer.java src/changes/changes.xml
Author: jochen Date: Wed Aug 2 08:35:40 2006 New Revision: 428030 URL: http://svn.apache.org/viewvc?rev=428030&view=rev Log: Fixed an endless loop, if the WebServer threw a BindException. Submitted-by: Stanislav Miklik, [EMAIL PROTECTED] Modified: webservices/xmlrpc/trunk/server/src/main/java/org/apache/xmlrpc/webserver/WebServer.java webservices/xmlrpc/trunk/src/changes/changes.xml Modified: webservices/xmlrpc/trunk/server/src/main/java/org/apache/xmlrpc/webserver/WebServer.java URL: http://svn.apache.org/viewvc/webservices/xmlrpc/trunk/server/src/main/java/org/apache/xmlrpc/webserver/WebServer.java?rev=428030&r1=428029&r2=428030&view=diff == --- webservices/xmlrpc/trunk/server/src/main/java/org/apache/xmlrpc/webserver/WebServer.java (original) +++ webservices/xmlrpc/trunk/server/src/main/java/org/apache/xmlrpc/webserver/WebServer.java Wed Aug 2 08:35:40 2006 @@ -196,7 +196,9 @@ Thread.sleep(l); } catch (InterruptedException ex) { } - } + } else { + break; +} } } } Modified: webservices/xmlrpc/trunk/src/changes/changes.xml URL: http://svn.apache.org/viewvc/webservices/xmlrpc/trunk/src/changes/changes.xml?rev=428030&r1=428029&r2=428030&view=diff == --- webservices/xmlrpc/trunk/src/changes/changes.xml (original) +++ webservices/xmlrpc/trunk/src/changes/changes.xml Wed Aug 2 08:35:40 2006 @@ -14,6 +14,10 @@ Fixed that the WebServer didn't wait before retrying to bind to the server socket. + +Fixed an endless loop, if the WebServer threw a BindException. +
Bug in xml-rpc rc1
Hello, I have probably found a bug in WebServer.shutdown(). This call has frozen, but I don't know why. Conditions that might affecting this: 1. I started the server with enabled extensions and enabled keepalive (others default, if not mentioned) 2. In the same program (in another thread of course) I create client connected to this server with enabled extensions 3. this client sends in loop requests to server (delayed for 2 seconds) 4. then I called shutdown on the server (e.g. after 10 seconds) When I try to debug it, my debugger (Eclipse) freeze on command pool.shutdown(); in method shutdown(). Hopefully this description will help. Bye Stano
Re: Bug in xml-rpc rc1
Stanislav Miklik wrote: I have probably found a bug in WebServer.shutdown(). This call has frozen, but I don't know why. Conditions that might affecting this: 1. I started the server with enabled extensions and enabled keepalive (others default, if not mentioned) 2. In the same program (in another thread of course) I create client connected to this server with enabled extensions 3. this client sends in loop requests to server (delayed for 2 seconds) 4. then I called shutdown on the server (e.g. after 10 seconds) When I try to debug it, my debugger (Eclipse) freeze on command pool.shutdown(); in method shutdown(). Hopefully this description will help. Following your description, I have written the small test program below. It works fine for me. Jochen package org.apache.xmlrpc.test; import java.net.URL; import org.apache.xmlrpc.client.XmlRpcClient; import org.apache.xmlrpc.client.XmlRpcClientConfigImpl; import org.apache.xmlrpc.server.PropertyHandlerMapping; import org.apache.xmlrpc.webserver.WebServer; import junit.framework.TestCase; /** Tests the web servers shutdown feature. */ public class ShutdownTest extends TestCase { public static class Adder { public int add(int p1, int p2) { return p1 + p2; } } private WebServer setupServer() throws Exception { WebServer server = new WebServer(0); PropertyHandlerMapping mapping = new PropertyHandlerMapping(); mapping.addHandler("Adder", Adder.class); server.getXmlRpcServer().setHandlerMapping(mapping); server.start(); return server; } public void testShutdown() throws Exception { final WebServer server = setupServer(); int port = server.getPort(); XmlRpcClient client = new XmlRpcClient(); XmlRpcClientConfigImpl config = new XmlRpcClientConfigImpl(); config.setServerURL(new URL("http://127.0.0.1:"; + port + "/")); client.setConfig(config); for (int i = 0; i < 10; i++) { Integer result = (Integer) client.execute("Adder.add", new Object[]{ new Integer(3), new Integer(5) }); assertEquals(8, result.intValue()); Thread.sleep(2000); } server.shutdown(); } } - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Bug in xml-rpc rc1
On 8/2/06, Jochen Wiedmann <[EMAIL PROTECTED]> wrote: Following your description, I have written the small test program below. It works fine for me. Jochen As I write before, the server was set to enabled for keapalive. I rewrite little bit your test to more match my case. And it hasn't stopped. package sk.sodik.server; import java.net.URL; import org.apache.xmlrpc.client.XmlRpcClient; import org.apache.xmlrpc.client.XmlRpcClientConfigImpl; import org.apache.xmlrpc.server.PropertyHandlerMapping; import org.apache.xmlrpc.server.XmlRpcServerConfigImpl; import org.apache.xmlrpc.webserver.WebServer; public class ShutdownTest { /** * @param args */ public static void main(String[] args) { try { new ShutdownTest().testShutdown(); } catch (Exception e) { e.printStackTrace(); } } public static class Adder { public int add(int p1, int p2) { return p1 + p2; } } private WebServer setupServer() throws Exception { WebServer server = new WebServer(0); PropertyHandlerMapping mapping = new PropertyHandlerMapping(); mapping.addHandler("Adder", Adder.class); server.getXmlRpcServer().setHandlerMapping(mapping); XmlRpcServerConfigImpl config = new XmlRpcServerConfigImpl(); config.setEnabledForExtensions(true); config.setKeepAliveEnabled(true); server.getXmlRpcServer().setConfig(config); server.start(); return server; } public void testShutdown() throws Exception { final WebServer server = setupServer(); final int port = server.getPort(); new Thread() { public void run() { try { XmlRpcClient client = new XmlRpcClient(); XmlRpcClientConfigImpl config = new XmlRpcClientConfigImpl(); config.setServerURL(new URL("http://127.0.0.1:"; + port + "/")); client.setConfig(config); for (int i = 0; i < 10; i++) { Integer result = (Integer) client .execute("Adder.add", new Object[] { new Integer(3), new Integer(5) }); System.out.println("Resut:"+result); Thread.sleep(2000); } } catch (Exception e) { e.printStackTrace(); } } }.start(); Thread.sleep(5000); System.out.println("Shuting down..."); server.shutdown(); System.out.println("done"); } }
[RESULT] Merge xmlrpc-dev and xmlrpc-user
Hi, first of all, I was rather happy to have so much response to this vote. I never found the xml-rpc project to be so alive before. :-) Nevertheless, here's the result: +1: 4 binding (Dims, Henri, Siegfried, Myself) 4 non-binding (String Larson, Donald Albertson, Steffen Pingel, Andreas Schölver) =0: 1 non-binding (Rutger Heijmerikx) -1: 2 non-binding (Michael Landon, Jimisola Laursen) The vote is accepted. Jochen -- My wife Mary and I have been married for forty-seven years and not once have we had an argument serious enough to consider divorce; murder, yes, but divorce, never. (Jack Benny) - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]