mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-04 07:35:24 +02:00
[278341] [dstore] Disconnect on idle causes the client hang
This commit is contained in:
parent
869a1b61cb
commit
c36a573770
2 changed files with 11 additions and 6 deletions
|
@ -1,5 +1,5 @@
|
|||
/*******************************************************************************
|
||||
* Copyright (c) 2002, 2008 IBM Corporation and others.
|
||||
* Copyright (c) 2002, 2009 IBM Corporation and others.
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Eclipse Public License v1.0
|
||||
* which accompanies this distribution, and is available at
|
||||
|
@ -14,6 +14,7 @@
|
|||
* Contributors:
|
||||
* David McKnight (IBM) [224906] [dstore] changes for getting properties and doing exit due to single-process capability
|
||||
* David McKnight (IBM) - [244388] [dstore] Connection hangs when a miner not installed
|
||||
* David McKnight (IBM) - [278341] [dstore] Disconnect on idle causes the client hang
|
||||
*******************************************************************************/
|
||||
|
||||
package org.eclipse.dstore.internal.core.server;
|
||||
|
@ -59,15 +60,19 @@ public class ServerCommandHandler extends CommandHandler
|
|||
}
|
||||
if (_serverTimedOut)
|
||||
{
|
||||
|
||||
System.out.println("server timed out");
|
||||
_dataStore.getCommandHandler().finish();
|
||||
_dataStore.getUpdateHandler().finish();
|
||||
_dataStore.finish();
|
||||
System.out.println(ServerReturnCodes.RC_FINISHED);
|
||||
|
||||
// only exit if there's no service manager
|
||||
if (SystemServiceManager.getInstance().getSystemService() == null)
|
||||
if (SystemServiceManager.getInstance().getSystemService() == null){
|
||||
System.exit(0);
|
||||
}
|
||||
else {
|
||||
_dataStore.getClient().disconnectServerReceiver();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -83,7 +88,6 @@ public class ServerCommandHandler extends CommandHandler
|
|||
// if we do timeout then it's time to shutdown the server
|
||||
return;
|
||||
}
|
||||
System.out.println("server timed out!"); //$NON-NLS-1$
|
||||
_serverTimedOut = true;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*******************************************************************************
|
||||
* Copyright (c) 2002, 2008 IBM Corporation and others.
|
||||
* Copyright (c) 2002, 2009 IBM Corporation and others.
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Eclipse Public License v1.0
|
||||
* which accompanies this distribution, and is available at
|
||||
|
@ -16,6 +16,7 @@
|
|||
* David McKnight (IBM) - [225902] [dstore] use C_NOTIFICATION command to wake up the server
|
||||
* David McKnight (IBM) - [229947] [dstore] interruption to Thread.sleep() should not stop waitForUpdate()
|
||||
* David McKnight (IBM) - [231126] [dstore] status monitor needs to reset WaitThreshold on nudge
|
||||
* David McKnight (IBM) - [278341] [dstore] Disconnect on idle causes the client hang
|
||||
*******************************************************************************/
|
||||
|
||||
package org.eclipse.rse.connectorservice.dstore.util;
|
||||
|
@ -346,7 +347,7 @@ public class StatusMonitor implements IDomainListener, ICommunicationsListener
|
|||
nudges++;
|
||||
WaitThreshold = initialWaitThreshold;
|
||||
}
|
||||
else if (_networkDown)
|
||||
else if (_networkDown || !_dataStore.isConnected())
|
||||
{
|
||||
dispose();
|
||||
throw new InterruptedException();
|
||||
|
|
Loading…
Add table
Reference in a new issue