|
From: Heiner W. <su...@ve...> - 2004-03-23 21:11:28
|
Hello!
I found a bug in jetties HttpServer, or HttpConnection,
depending on how you intend to fix it.
In short the scenario is:
1. Start HTTP-server with servlet installed,
2. open connection to servlet and use it once with
"Connection: keep-alive"
3. stop() and destroy() the server
4. immediatly after that fire up another server on the same host/port
5. send another request through the open connection.
This should give an IOException (socket closed) which can
be caught to reopen the connection (this is what commons-http-client does).
The reopen would connect to the new server and everything would be ok.
What happens is, that the HttpConnection is still open and references
the HTTP server object which is unusable after the destroy()
-> NPE -> HTTP 500 Server Error -> no retry!
It first seems the newly started server misbehaves, but it does not even
see the request.
Find a JUnit test attached (accompanied by a little servlet)
which proves that I get "HTTP 500" from a destroyed server.
The bug does not fire in the debugger, because the keep-alive
timeout is usualy too short.
Regards,
Heiner
|