When my test spawns the "server shutdown", the "server start" process exits 
shortly afterward, except that it prints a message on its STDOUT:

Wed Nov 23 09:09:25 EST 2016 : Invalid reply from network server: Insufficient 
data

The *"server start"* process is the one which has this behavior?

Thank you for clarifying that, I didn't understand that detail initially.

This feels almost identical to a similar problem in one of the Derby
regression test suites:

        
https://issues.apache.org/jira/browse/DERBY-6337?focusedCommentId=13976483&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-13976483

Here's what Knut Anders suggested at the time:

        The "insufficient data" error indicates that the ping
        command was able to connect to the server, but didn't
        get a full response back from it. I suppose that it
        might happen if the server shutdown is completed after
        the ping command has connected to it and before the
        response has been sent back.

I think that, basically, the problem is that the Network Server is
multi-threaded and has some rather complex internal state, and the
simple atomic operation that we think of as "server shutdown" is
actually more complex, and so there can be a situation, where the server
shutdown interrupts/interferes with other server connections that are
still connected at the time.

I'm speculating that the "server start" part of your system has
retained some level of connection to the Derby Network Server, even
though the Network Server is already up-and-running.

Then, subsequently, the "server shutdown" request interrupts the
"server start" connection, not allowing it a chance to fully
send the network messages back to your client.

And so the code on the client sees a partial response from the
server, and tells you that fact.

Unfortunately, this doesn't look like a simple situation to improve.

From what I can tell by studying DERBY-6337, the solution that
the developers chose at the time was to recognize in the test program
that this was a possible result, and to teach the test program to
allow for this awkward response from shutting the server down.

You could certainly log an enhancement request to try to make
this cleaner, although I think if there were an easy way to do
that, it would have been pursued during the DERBY-6337 research.

However, it's interesting to me that it's the "server start" part
of your test which receives this error.

That says to me that the mechanism you're using the *start* the
server is successfully starting the Network Server, but is also
retaining a network connection to the server, which doesn't seem
necessary to me.

If that startup technique were able to start the Network Server,
then "detach" from it, then when the server is subsequently shut
down, it wouldn't have any message to try to send back to that
startup connection (since the connection would no longer exist),
and so the partial message error would not arise.

Lots of speculation and hand-waving here, but perhaps it gives
you some more ideas about further diagnosis you can perform?

thanks,

bryan

Reply via email to