[ http://issues.apache.org/jira/browse/DERBY-1326?page=comments#action_12414193 ]
Bryan Pendleton commented on DERBY-1326: ---------------------------------------- I think that the cause of the new "Insufficient data" exception that is appearing with sessionMgmt1.diff has to do with a specific part of the change to the NetworkServerControlImpl restart processing. I changed the restart processing so that, instead of just closing the Session objects on the RunQueue, the restart code closes *all* the Session objects in the sessionTable. In general, I think that this is the right thing to do, as restart processing needs to close all the sessions, not just those that are currently waiting for a free thread. However, the new code is too powerful, because it also closes the current Session, which is the session which is performing the shutdown. Closing the current Session terminates it before it has a chance to format and return the Shutdown Exception message back to the client. When the client doesn't get the expected Shutdown Exception, it reports this as "Insufficient data". If I tweak the patch so that the restart logic is changed back to just closing the Sessions on the RunQueue, the nasty "Insufficient data" exception disappears, and the client gets a much more reasonable message: ERROR XJ015: DERBY SQL error: SQLCODE: -1, SQLSTATE: XJ015, SQLERRMC: Derby system shutdown. So I think that the patch should be slightly modified, so that this critical loop in the restart processing gets implemented as: "For each Session in the sessionTable, *except for the Session performing the shutdown*, close it" But I'm not quite sure how to code that "except" clause. > Network server may abandon sessions when Derby system is shutdown and this > causes intermittent hangs in the client > ------------------------------------------------------------------------------------------------------------------ > > Key: DERBY-1326 > URL: http://issues.apache.org/jira/browse/DERBY-1326 > Project: Derby > Type: Bug > Components: Network Server > Reporter: Deepa Remesh > Assignee: Bryan Pendleton > Attachments: repro1326.java, sessionMgmt1.diff, > sessionMgmt1_and_nosessionsforclosedthreads.diff > > This issue was found when working on DERBY-1219. More details can be found in > the comments at http://issues.apache.org/jira/browse/DERBY-1219 -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira