Bug 278341 - [dstore] Disconnect on idle causes the client hang
Summary: [dstore] Disconnect on idle causes the client hang
Status: RESOLVED FIXED
Alias: None
Product: Target Management
Classification: Tools
Component: RSE (show other bugs)
Version: 3.1   Edit
Hardware: PC Windows XP
: P1 critical (vote)
Target Milestone: 3.1 RC3   Edit
Assignee: David McKnight CLA
QA Contact: Martin Oberhuber CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 278619
  Show dependency tree
 
Reported: 2009-05-29 04:13 EDT by Masao Nishimoto CLA
Modified: 2009-06-03 19:37 EDT (History)
1 user (show)

See Also:
mober.at+eclipse: pmc_approved+
kjdoyle: review+


Attachments
patch to disconnect when in single-server mode as well as check for isConnected() in statusmonitor (4.03 KB, patch)
2009-06-01 10:08 EDT, David McKnight CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Masao Nishimoto CLA 2009-05-29 04:13:21 EDT
After the server disconnects an idle client because the idle time exceeds DSTORE_IDLE_SHUTDOWN_TIMEOUT, and before the client detects the disconnect, if a client performs some operation, the client hangs.  There are at least 2 problems.

1. Disconnect on the server for an idle client is not reflected to the client immediately.  e.g. It takes 2 minutes.

2. StatusMonitor runs in the UI thread, and ConnectionStatusListener.ConnectionDown is blocked.
Comment 1 Martin Oberhuber CLA 2009-05-29 04:20:39 EDT
Ouch, this sounds bad.

When the client "hangs" is there anything the user can do to get it work again or is all of Eclipse dead?
Comment 2 Masao Nishimoto CLA 2009-05-29 04:30:25 EDT
The user cannot do anything, and kills the workbench from the task manager.
Comment 3 Martin Oberhuber CLA 2009-05-29 04:33:15 EDT
Ouch. We cannot allow this into 3.1 and better fix ASAP. Dave can you handle this?
Comment 4 Martin Oberhuber CLA 2009-05-29 04:33:54 EDT
Masao, this is on Windows with 3.1RC?
Comment 5 David McKnight CLA 2009-05-29 09:40:10 EDT
Masao, are you able to reproduce this with just base-RSE (i.e. not a z/OS connection)?  What value do you give DSTORE_IDLE_SHUTDOWN_TIMEOUT?  
Comment 6 Masao Nishimoto CLA 2009-06-01 01:07:22 EDT
The version in use is 3.0.3.

The first problem does not occur with Unix or REXEC, where the server is terminated by System.exit() on disconnect, and the socket is closed implicitly.
Comment 7 David McKnight CLA 2009-06-01 10:08:01 EDT
Created attachment 137846 [details]
patch to disconnect when in single-server mode as well as check for isConnected() in statusmonitor

Masao, does this patch help?
Comment 8 David McKnight CLA 2009-06-01 10:10:57 EDT
I've opened bug 278619 for the backport to the RSE 3.0.3+ maintenance branch.
Comment 9 David McKnight CLA 2009-06-01 13:06:09 EDT
Kevin, could you review this please?  
Comment 10 Kevin Doyle CLA 2009-06-01 13:58:41 EDT
Review +.
Comment 11 David McKnight CLA 2009-06-01 14:02:49 EDT
Thanks Kevin, I've committed the fix to cvs.
Comment 12 Masao Nishimoto CLA 2009-06-02 03:28:09 EDT
I tried the fix, and confirmed it works good.
Comment 13 Martin Oberhuber CLA 2009-06-03 11:57:22 EDT
The code in CVS ServerCommandHandler v1.12 line 63 doesn't match the patch
attached here:

			if (_serverTimedOut)
			{
				System.out.println("server timed out");


Please review whether the System.out.println() is appropriate at this point.
Comment 14 David McKnight CLA 2009-06-03 12:02:23 EDT
(In reply to comment #13)
> The code in CVS ServerCommandHandler v1.12 line 63 doesn't match the patch
> attached here:
> 
>                         if (_serverTimedOut)
>                         {
>                                 System.out.println("server timed out");
> 
> 
> Please review whether the System.out.println() is appropriate at this point.
> 

The print was used for testing.  I've taken that out now and recommitted.