[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[tm-cvs-commit] dmcknight org.eclipse.tm.rse/plugins/org.eclipse.dstore.core/src/org/eclipse/dstore/internal/core/server ServerCommandHandler.java

Update of /cvsroot/tools/org.eclipse.tm.rse/plugins/org.eclipse.dstore.core/src/org/eclipse/dstore/internal/core/server
In directory dev1:/tmp/cvs-serv10963/src/org/eclipse/dstore/internal/core/server

Modified Files:
      Tag: R3_2_maintenance
	ServerCommandHandler.java 
Log Message:
[373459] [dstore][multithread] duplicate finish() calls during idle timeout


Index: ServerCommandHandler.java
===================================================================
RCS file: /cvsroot/tools/org.eclipse.tm.rse/plugins/org.eclipse.dstore.core/src/org/eclipse/dstore/internal/core/server/ServerCommandHandler.java,v
retrieving revision 1.15.2.1
retrieving revision 1.15.2.2
diff -C2 -d -r1.15.2.1 -r1.15.2.2
*** ServerCommandHandler.java	13 Feb 2012 21:05:04 -0000	1.15.2.1
--- ServerCommandHandler.java	7 Mar 2012 18:06:10 -0000	1.15.2.2
***************
*** 19,22 ****
--- 19,23 ----
   *  David McKnight   (IBM) - [294933] [dstore] RSE goes into loop
   *  David McKnight   (IBM) - [371401] [dstore][multithread] avoid use of static variables - causes memory leak after disconnect
+  *  David McKnight   (IBM) - [373459] [dstore][multithread] duplicate finish() calls during idle timeout
   *******************************************************************************/
  
***************
*** 41,45 ****
  
  /**
!  * The ServerCommandHandler is reponsible for maintaining
   * a queue of commands and periodically routing commands
   * from the queue to the appropriate miners.
--- 42,46 ----
  
  /**
!  * The ServerCommandHandler is responsible for maintaining
   * a queue of commands and periodically routing commands
   * from the queue to the appropriate miners.
***************
*** 61,78 ****
  			while (!_serverTimedOut)
  			{
  				waitForTimeout();
  			}
  			if (_serverTimedOut)
  			{
- 				_dataStore.getCommandHandler().finish();
- 				_dataStore.getUpdateHandler().finish();
- 				_dataStore.finish();
- 				System.out.println(ServerReturnCodes.RC_FINISHED);
  				if (_dataStore.getClient() != null) {
  					_dataStore.getClient().getLogger().logInfo(this.getClass().toString(), "Server timeout");
  				}
! 				
  				// only exit if there's no service manager
  				if (SystemServiceManager.getInstance().getSystemService() == null){
  					System.exit(0);
  				}
--- 62,81 ----
  			while (!_serverTimedOut)
  			{
+ 				if (_dataStore.getClient() != null) {
+ 					_dataStore.getClient().getLogger().logInfo(this.getClass().toString(), "ServerIdleThread.waitForTimeout()..."); //$NON-NLS-1$
+ 				}
  				waitForTimeout();
  			}
  			if (_serverTimedOut)
  			{
  				if (_dataStore.getClient() != null) {
  					_dataStore.getClient().getLogger().logInfo(this.getClass().toString(), "Server timeout");
  				}
! 
  				// only exit if there's no service manager
  				if (SystemServiceManager.getInstance().getSystemService() == null){
+ 					_dataStore.getCommandHandler().finish();
+ 					_dataStore.getUpdateHandler().finish();
+ 					_dataStore.finish();
  					System.exit(0);
  				}
***************
*** 202,213 ****
  	public void finish()
  	{
! 		if (_serverIdleThread != null && _serverIdleThread.isAlive()){
! 			_serverIdleThread._serverTimedOut=true; // ensures that the wait loop won't continue after the interrupt
! 			_serverIdleThread.interrupt();
  		}
! 		_serverIdleThread = null;
  
! 		if (_minerLoader != null)
  			_minerLoader.finishMiners();
  		super.finish();
  	}
--- 205,234 ----
  	public void finish()
  	{
! 		if (_dataStore.getClient() != null) {
! 			_dataStore.getClient().getLogger().logInfo(this.getClass().toString(), "ServerCommandHandler.finish()"); //$NON-NLS-1$
  		}
! 		
! 		if (_serverIdleThread != null){
! 			if (_dataStore.getClient() != null) {
! 				_dataStore.getClient().getLogger().logInfo(this.getClass().toString(), "ServerCommandHandler clearing server idle thread"); //$NON-NLS-1$
! 			}
! 			
! 			if (_serverIdleThread.isAlive()){
! 				_serverIdleThread._serverTimedOut = true;
! 				_serverIdleThread.interrupt();
! 			}
! 			_serverIdleThread = null;
! 		}
! 		
  
! 		if (_minerLoader != null){
! 			if (_dataStore.getClient() != null) {
! 				_dataStore.getClient().getLogger().logInfo(this.getClass().toString(), "ServerCommandHandler.finish() - calling finishMiners..."); //$NON-NLS-1$
! 			}
  			_minerLoader.finishMiners();
+ 			if (_dataStore.getClient() != null) {
+ 				_dataStore.getClient().getLogger().logInfo(this.getClass().toString(), "ServerCommandHandler.finish() - ...completed calling finishMiners"); //$NON-NLS-1$
+ 			}		
+ 		}
  		super.finish();
  	}