You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@turbine.apache.org by Daniel Rall <dl...@finemaltcoding.com> on 2001/08/11 12:23:30 UTC
Re: XmlRpc service not shutting down
This patch is finally in XML-RPC CVS (checked in it a few minutes
ago).
> > -----Original Message-----
> > From: dlr@despot.finemaltcoding.com
> > [mailto:dlr@despot.finemaltcoding.com]On Behalf Of Daniel Rall
> > Sent: Saturday, March 17, 2001 18:59
> > To: xmlrpc@helma.org
> > Cc: turbine-dev@jakarta.apache.org
> > Subject: Re: XmlRpc service not shutting down
> >
> >
> > [helma.org guys, please CC the Turbine list on any responses...thanks!]
> >
> > "Ilkka Priha" <ip...@surfeu.fi> writes:
> >
> > > Sorry, didn't help. The helma webserver shutdown method sets a listener
> > > acting as a flag to null and calls interrupt() for the thread,
> > but blocking
> > > I/O operations don't care about thread interrupts. By default,
> > the server
> > > socket accept() method waits forever or until the socket is
> > closed. I think
> > > that the server socket should either have a preset SO_TIMEOUT
> > interrupting
> > > I/O waits at regular intervals or the shutdown() method should
> > simply close
> > > the server socket.
> >
> > Ah, indeed. Nice description of the problem--so nice, in fact, that I've
> > attempted an implementation:
> >
> > diff -u
> > /home/dlr/src/xmlrpc-java/src/helma/xmlrpc/WebServer.java-ORIG
> > /home/dlr/src/xmlrpc-java/src/helma/xmlrpc/WebServer.java
> > ---
> > /home/dlr/src/xmlrpc-java/src/helma/xmlrpc/WebServer.java-ORIG
> > Sat Mar 17 08:49:13 2001
> > +++ /home/dlr/src/xmlrpc-java/src/helma/xmlrpc/WebServer.java Sat
> > Mar 17 08:49:13 2001
> > @@ -76,14 +76,15 @@
> > /**
> > * Creates a Web server at the specified port number and IP address.
> > */
> > - public WebServer (int port, InetAddress add) throws IOException {
> > + public WebServer (int port, InetAddress addr) throws IOException {
> > this.port = port;
> > xmlrpc = new XmlRpcServer ();
> > accept = new Vector ();
> > deny = new Vector ();
> > threadpool = new Stack ();
> > runners = new ThreadGroup ("XML-RPC Runner");
> > - this.serverSocket = new ServerSocket (port, 50, add);
> > + serverSocket = new ServerSocket (port, 50, addr);
> > + serverSocket.setSoTimeout (8192);
> > listener = new Thread (this, "XML-RPC Weblistener");
> > listener.start();
> > }
> > @@ -179,6 +180,8 @@
> > // new Connection (socket);
> > } else
> > socket.close ();
> > + } catch (InterruptedIOException checkState) {
> > + // Timeout waiting for a client...try again if still
> > listening.
> > } catch (Exception ex) {
> > System.err.println("Exception in XML-RPC listener
> > loop (" + ex + ").");
> > } catch (Error err) {
> >
> > In the above patch, I worry about how clients will react during the
> > short period where the WebServer does not have a ServerSocket accepting
> > connections. Additionally, the ~8 sec. SO_TIMEOUT wait time was guess.
> >
> > Thoughts?
> > --
> >
> > Daniel Rall <dl...@collab.net>
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: turbine-dev-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: turbine-dev-help@jakarta.apache.org
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: turbine-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: turbine-dev-help@jakarta.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-dev-help@jakarta.apache.org