Hi Benson,

I finally got a runnable EngineLifecycleTest without any ignore test case.

Please see my comments in the mail.

Benson Margulies wrote:
The NPE is very simple. Sometimes, and I can't explain when, the Jetty
connector does not create its server socket when we think it does. The
fix is to call .open() on the connector before asking it for the socket
for the purpose of setReuseAddress.

There are some check points in the connector's open method.
Maybe them can cause some side effect on the connector's connection.
Anyway , I added a checking for the connector.getConnection() in the EngineLifecycleTest to call
the .open() if it is necessary.
I cannot explain why only some runs of the systests from mvn come up
with this situation, while other runs don't and I've never persuaded it
to malfunction in Eclipse, try though I might. The jetty lifecycle
doStart calls open on the connector. I'm led to wonder if there is some
case in which we reuse the connector object so it doesn't get 'start-ed'
again. I would suggest adding more assertions to the EngineLifecycleTest
to verify that things are really shut down when they are supposed to be.

It is because the system property which DanKulp set for not shutting down the service in Linux Box.
I add some code to override the system property in the EngineLifecycleTest.
In terms of the original task, which was to set ReuseAddress so that
tests that flip-flop the server could run without incident, I wonder how
we want this to work in the general feature case.
I can do some hacking work on the default connector to set socket to reuse the address in the
JettyHTTPServerEngine.
There is a possible security exposure involved in routinely turning on
setReuseAddress. So I think that it should be parameterized in the
configuration XML.
Do you mean that we can add a configuration option (such as ReuseAddress) which can set the default the connector's socket address be reusable? If so , I think this function is very easy to be added.

Willem.

  • Willem's NPE Benson Margulies
    • Re: Willem's NPE Willem Jiang

Reply via email to