show-queue cannot be starved for admins
When admin executes the show-queue command a new thread will be created to make sure that the commmand is always executed even if the thread pool is exhausted. Bug: issue 570
This commit is contained in:
		 carloseduardo.baldacin
					carloseduardo.baldacin
				
			
				
					committed by
					
						 Ulrik Sjölin
						Ulrik Sjölin
					
				
			
			
				
	
			
			
			 Ulrik Sjölin
						Ulrik Sjölin
					
				
			
						parent
						
							8ef3b69f35
						
					
				
				
					commit
					617be71c21
				
			| @@ -238,7 +238,8 @@ public abstract class BaseCommand implements Command { | ||||
|    */ | ||||
|   protected synchronized void startThread(final CommandRunnable thunk) { | ||||
|     final TaskThunk tt = new TaskThunk(thunk); | ||||
|     if (isAdminCommand()) { | ||||
|  | ||||
|     if (isAdminCommand()||(isAdminHighPriorityCommand() && userProvider.get().isAdministrator())) { | ||||
|       // Admin commands should not block the main work threads (there | ||||
|       // might be an interactive shell there), nor should they wait | ||||
|       // for the main work threads. | ||||
| @@ -253,6 +254,10 @@ public abstract class BaseCommand implements Command { | ||||
|     return getClass().getAnnotation(AdminCommand.class) != null; | ||||
|   } | ||||
|  | ||||
|   private final boolean isAdminHighPriorityCommand() { | ||||
|     return getClass().getAnnotation(AdminHighPriorityCommand.class) != null; | ||||
|   } | ||||
|  | ||||
|   /** | ||||
|    * Terminate this command and return a result code to the remote client. | ||||
|    * <p> | ||||
|   | ||||
		Reference in New Issue
	
	Block a user