[ 
http://issues.apache.org/jira/browse/DERBY-1326?page=comments#action_12414585 ] 

Bryan Pendleton commented on DERBY-1326:
----------------------------------------

I had an idea about how to address the "failure to create a new thread" aspect
of the hang, as follows:

Suppose that, at the end of restart processing, we go ahead and create a new
DRDAConnThread instance, even though at this instance there may not be
any sessions for it to process yet. If not, it will just go into getNextSession 
and wait.

With the current combined patch, during restart processing, we "poison" each
of the DRDAConnThread instances by closing and interrupting them, so that
we know that at some point those threads will die.

The problem that we had was that if a new session came in while all those
poisoned threads were still in the process of dieing, then the 
create-new-session
logic might not realize that it needed to create a new thread because it might
mistakenly see a non-zero freeThreads count which was counting only poisoned
threads.

But if we always create at least one new thread, then we know that the new
session will eventually get processed by that new thread.

In order for this to be 100% solid I think we have to change runQueueAdd to do
a notifyAll(), but that's a slightly different topic, and I think I'll put that 
bit into
the Wiki page, because it should live beyond this bug.

So, in conclusion, here is my latest idea:
1) At the end of restart processing, create a new thread even though we may not
have any new sessions for it to process yet.
2) change runQueueAdd to do a notifyAll(), not a notify().

> 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

Reply via email to