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

Deepa Remesh updated DERBY-1326:
--------------------------------

    Attachment: sessionMgmt1_and_nosessionsforclosedthreads.diff

Hi Bryan,

I saw your question and suggestions in the previous comment while I was working 
on this new combined patch. So this comment may sound off-base but I am just 
posting my thoughts. 

I was experimenting a bit with your patch and I think it is not the code that 
you added in DRDAConnThread.run method which makes this new exception appear 
intstead of the old one. Reason I say this is I modified your patch trying to 
see how we can avoid the closed_thread_getting_valid_session scenario. In this 
patch, I removed the code you commented with //FIXME in DRDAConnThread.run. 
Even after that, I see the same exception instead of the usual shutdown 
exception. However, I have not figured out what is causing this new exception.

In the attached trial patch 'sessionMgmt1_and_nosessionsforclosedthreads.diff', 
I combined your patches 'sessionMgmt1.diff' and 
'no-sessions-for-closed-threads.diff'. To me, it looked like 
'sessionMgmt1.diff' solves all problems which we found except for 
closed_thread_getting_valid_session scenario. This scenario seems to be solved 
by your previous patch 'no-sessions-for-closed-threads.diff'. The problem which 
we found previously with 'no-sessions-for-closed-threads.diff' was that the 
"createSession" was thinking there are freeThreads (freeThreads !=0 ). But 
actually the threads it were thinking as available were already closed. For the 
combined patch to work, freeThreads must become 0 after a restart. This is to 
ensure that a new thread is created when a  new session comes in after a 
restart. I think the interrupt calls and the added synchronization assure that 
freeThreads will become 0 before we start accepting new sessions. Does this 
sound right?

I have run the repro multiple times with this patch and did not see the hang.  
If you think this patch makes sense, can you please try it on the machine where 
you can repro the hang easily to see if solves the hang? Thanks.

I will think more about your question and suggestions in the previous comment 
as I am planning to look at DERBY-803/DERBY-1020 later today.

> 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