CLOUDSTACK-8656: debug messages on interupted exceptions

This commit is contained in:
Daan Hoogland 2015-07-30 16:03:10 +02:00
parent 520e0c8de0
commit e2b6237464
31 changed files with 58 additions and 10 deletions

View File

@ -464,6 +464,7 @@ public class AgentShell implements IAgentShell, Daemon {
while (!_exit)
Thread.sleep(1000);
} catch (InterruptedException e) {
s_logger.debug("[ignored] AgentShell was interupted.");
}
} catch (final ConfigurationException e) {

View File

@ -104,7 +104,7 @@ public class VmRulesetLogDaoImpl extends GenericDaoBase<VmRulesetLogVO, Long> im
try {
Thread.sleep(delayMs);
} catch (InterruptedException ie) {
s_logger.debug("[ignored] interupted while inserting security group rule log.");
}
} else
s_logger.warn("Caught another deadlock exception while retrying inserting security group rule log, giving up");

View File

@ -274,7 +274,9 @@ public class StorageCacheManagerImpl implements StorageCacheManager, Manager {
s_logger.debug("waiting cache copy completion type: " + typeName + ", id: " + obj.getObjectId() + ", lock: " + lock.hashCode());
try {
lock.wait(miliSeconds);
} catch (InterruptedException e) {}
} catch (InterruptedException e) {
s_logger.debug("[ignored] interupted while waiting for cache copy completion.");
}
s_logger.debug("waken up");
now = new Date();

View File

@ -170,6 +170,7 @@ public class ClusterServiceServletContainer {
try {
Thread.sleep(1000);
} catch (InterruptedException e1) {
s_logger.debug("[ignored] interupted while waiting to retry running the servlet container.");
}
}
}

View File

@ -144,6 +144,7 @@ public class Merovingian2 extends StandardMBean implements MerovingianMBean {
}
Thread.sleep(5000);
} catch (InterruptedException e) {
s_logger.debug("[ignored] interupted while aquiring " + key);
}
}
String msg = "Timed out on acquiring lock " + key + " . Waited for " + ((InaccurateClock.getTime() - startTime)/1000) + "seconds";

View File

@ -54,6 +54,7 @@ public class GlobalLockTest {
Thread.sleep(jobDuration * 1000);
}
} catch (InterruptedException e) {
s_logger.debug("[ignored] interupted while testing global lock.");
} finally {
if (locked) {
boolean unlocked = WorkLock.unlock();

View File

@ -326,6 +326,7 @@ public class MessageBusBase implements MessageBus {
try {
wait();
} catch (InterruptedException e) {
s_logger.debug("[ignored] interupted while guarding re-entrance on message bus.");
}
} else {
break;

View File

@ -41,6 +41,7 @@ public class MessageDetector implements MessageSubscriber {
try {
wait(timeoutInMiliseconds);
} catch (InterruptedException e) {
s_logger.debug("[ignored] interupted while waiting on any message.");
}
}
}

View File

@ -18,13 +18,17 @@
*/
package org.apache.cloudstack.framework.sampleserver;
import org.apache.log4j.Logger;
public class SampleManagementServer {
private static final Logger s_logger = Logger.getLogger(SampleManagementServer.class);
public void mainLoop() {
while (true) {
try {
Thread.sleep(1000);
} catch (InterruptedException e) {
s_logger.debug("[ignored] .");
}
}
}

View File

@ -22,6 +22,11 @@ import javax.inject.Inject;
import junit.framework.TestCase;
import org.apache.cloudstack.framework.messagebus.MessageBus;
import org.apache.cloudstack.framework.messagebus.MessageDetector;
import org.apache.cloudstack.framework.messagebus.MessageSubscriber;
import org.apache.cloudstack.framework.messagebus.PublishScope;
import org.apache.log4j.Logger;
import org.junit.Assert;
import org.junit.Test;
import org.junit.runner.RunWith;
@ -29,14 +34,10 @@ import org.mockito.Mockito;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import org.apache.cloudstack.framework.messagebus.MessageBus;
import org.apache.cloudstack.framework.messagebus.MessageDetector;
import org.apache.cloudstack.framework.messagebus.MessageSubscriber;
import org.apache.cloudstack.framework.messagebus.PublishScope;
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(locations = "classpath:/MessageBusTestContext.xml")
public class TestMessageBus extends TestCase {
private static final Logger s_logger = Logger.getLogger(TestMessageBus.class);
@Inject
MessageBus _messageBus;
@ -128,6 +129,7 @@ public class TestMessageBus extends TestCase {
try {
Thread.sleep(3000);
} catch (InterruptedException e) {
s_logger.debug("[ignored] .");
}
_messageBus.publish(null, "Host", PublishScope.GLOBAL, null);
}
@ -148,6 +150,7 @@ public class TestMessageBus extends TestCase {
try {
thread.join();
} catch (InterruptedException e) {
s_logger.debug("[ignored] .");
}
}
}

View File

@ -61,6 +61,7 @@ public class AsyncJobManagerTest extends TestCase {
try {
Thread.sleep(3000);
} catch (InterruptedException e) {
s_logger.debug("[ignored] .");
}
s_logger.info("wakeup");
@ -119,6 +120,7 @@ public class AsyncJobManagerTest extends TestCase {
try {
Thread.sleep(1000);
} catch (InterruptedException e) {
s_logger.debug("[ignored] .");
}
}

View File

@ -52,6 +52,7 @@ public class AsyncJobTestDispatcher extends AdapterBase implements AsyncJobDispa
try {
Thread.sleep(interval);
} catch (InterruptedException e) {
s_logger.debug("[ignored] .");
}
_asyncJobMgr.completeAsyncJob(job.getId(), Status.SUCCEEDED, 0, null);

View File

@ -23,6 +23,8 @@ import java.util.List;
import java.util.Map;
import java.util.Properties;
import org.apache.log4j.Logger;
import com.mysql.jdbc.BalanceStrategy;
import com.mysql.jdbc.Connection;
import com.mysql.jdbc.ConnectionImpl;
@ -30,6 +32,7 @@ import com.mysql.jdbc.LoadBalancingConnectionProxy;
import com.mysql.jdbc.SQLError;
public class StaticStrategy implements BalanceStrategy {
private static final Logger s_logger = Logger.getLogger(StaticStrategy.class);
public StaticStrategy() {
}
@ -91,6 +94,7 @@ public class StaticStrategy implements BalanceStrategy {
try {
Thread.sleep(250);
} catch (InterruptedException e) {
s_logger.debug("[ignored] interupted while fail over in progres.");
}
// start fresh

View File

@ -303,6 +303,7 @@ public class BareMetalResourceBase extends ManagerBase implements ServerResource
try {
TimeUnit.SECONDS.sleep(1);
} catch (InterruptedException e) {
s_logger.debug("[ignored] interupted while waiting to retry running script.");
}
continue;
} else if (res == null) {

View File

@ -2382,6 +2382,7 @@ public class HypervDirectConnectResource extends ServerResourceBase implements S
try {
Thread.sleep(5000);
} catch (InterruptedException ex) {
s_logger.debug("[ignored] interupted while waiting to retry connecting to vm after exception: "+e.getLocalizedMessage());
}
}
} finally {
@ -2396,6 +2397,7 @@ public class HypervDirectConnectResource extends ServerResourceBase implements S
try {
Thread.sleep(1000);
} catch (InterruptedException ex) {
s_logger.debug("[ignored] interupted while connecting to vm.");
}
}

View File

@ -160,13 +160,13 @@ public class KVMHAMonitor extends KVMHABase implements Runnable {
try {
monitorThread.join();
} catch (InterruptedException e) {
s_logger.debug("[ignored] interupted joining monitor.");
}
try {
Thread.sleep(_heartBeatUpdateFreq);
} catch (InterruptedException e) {
s_logger.debug("[ignored] interupted between heartbeats.");
}
}
}

View File

@ -286,6 +286,7 @@ public class KVMStoragePoolManager {
try {
Thread.sleep(30000);
} catch (InterruptedException e) {
s_logger.debug("[ignored] interupted while trying to get storage pool.");
}
cnt++;
}

View File

@ -321,6 +321,7 @@ public class VmwareManagerImpl extends ManagerBase implements VmwareManager, Vmw
try {
_hostScanScheduler.awaitTermination(3000, TimeUnit.MILLISECONDS);
} catch (InterruptedException e) {
s_logger.debug("[ignored] interupted while stopping<:/.");
}
shutdownCleanup();

View File

@ -784,6 +784,7 @@ public class VmwareResource implements StoragePoolResource, ServerResource, Vmwa
Thread.currentThread();
Thread.sleep(1000);
} catch (InterruptedException e) {
s_logger.debug("[ignored] interupted while trying to get mac.");
}
}
@ -4818,6 +4819,7 @@ public class VmwareResource implements StoragePoolResource, ServerResource, Vmwa
try {
Thread.sleep(5000);
} catch (InterruptedException ex) {
s_logger.debug("[ignored] interupted while waiting to retry connect after failure.", e);
}
}
} finally {
@ -4832,6 +4834,7 @@ public class VmwareResource implements StoragePoolResource, ServerResource, Vmwa
try {
Thread.sleep(1000);
} catch (InterruptedException ex) {
s_logger.debug("[ignored] interupted while waiting to retry connect.");
}
}

View File

@ -954,6 +954,7 @@ public class NetscalerResource implements ServerResource {
try {
Thread.sleep(10000);
} catch (InterruptedException e) {
s_logger.debug("[ignored] interupted while waiting for netscaler to be 'up'.");
}
ns refreshNsObj = new ns();
refreshNsObj.set_id(newVpx.get_id());

View File

@ -221,6 +221,7 @@ public class SnapshotManagerImpl extends ManagerBase implements SnapshotManager,
try {
Thread.sleep(_pauseInterval * 1000);
} catch (InterruptedException e) {
s_logger.debug("[ignored] interupted while retry cmd.");
}
s_logger.debug("Retrying...");

View File

@ -61,6 +61,7 @@ public class SystemVmLoadScanner<T> {
try {
_capacityScanScheduler.awaitTermination(1000, TimeUnit.MILLISECONDS);
} catch (InterruptedException e) {
s_logger.debug("[ignored] interupted while stopping systemvm load scanner.");
}
_capacityScanLock.releaseRef();

View File

@ -230,6 +230,7 @@ public abstract class ConsoleProxyClientBase implements ConsoleProxyClient, Cons
try {
Thread.sleep(100);
} catch (InterruptedException e) {
s_logger.debug("[ignored] Console proxy was interupted while waiting for viewer to become ready.");
}
}
return false;
@ -341,6 +342,7 @@ public abstract class ConsoleProxyClientBase implements ConsoleProxyClient, Cons
try {
tileDirtyEvent.wait(3000);
} catch (InterruptedException e) {
s_logger.debug("[ignored] Console proxy ajax update was interupted while waiting for viewer to become ready.");
}
}
}

View File

@ -111,6 +111,7 @@ public class ConsoleProxyGCThread extends Thread {
try {
Thread.sleep(5000);
} catch (InterruptedException ex) {
s_logger.debug("[ignored] Console proxy was interupted during GC.");
}
}
}

View File

@ -802,6 +802,7 @@ public class ApiCommand {
try {
Thread.sleep(1000);
} catch (InterruptedException e) {
s_logger.debug("[ignored] interupted while during async job result query.");
}
} else {
break;

View File

@ -1337,6 +1337,7 @@ public class StressTestDirectAttach {
try {
Thread.sleep(1000);
} catch (InterruptedException e) {
s_logger.debug("[ignored] interupted while during async job result query.");
}
} else {
break;

View File

@ -2273,6 +2273,7 @@ public class TestClientWithAPI {
try {
Thread.sleep(1000);
} catch (InterruptedException e) {
s_logger.debug("[ignored] interupted while during async job result query.");
}
} else {
break;

View File

@ -67,7 +67,7 @@ public class ConsoleProxy implements Runnable {
try {
Thread.sleep(1000);
} catch (InterruptedException e) {
s_logger.debug("[ignored] interupted.");
}
}

View File

@ -1333,6 +1333,7 @@ public class HypervisorHostHelper {
try {
Thread.sleep(1000);
} catch (InterruptedException e) {
s_logger.debug("[ignored] interupted while waiting to config vm.");
}
}
}

View File

@ -243,6 +243,7 @@ public class VirtualMachineMO extends BaseMO {
try {
Thread.sleep(1000);
} catch (InterruptedException e) {
s_logger.debug("[ignored] interupted while dealing with vm questions.");
}
}
s_logger.info("VM Question monitor stopped");
@ -289,6 +290,7 @@ public class VirtualMachineMO extends BaseMO {
try {
Thread.sleep(1000);
} catch (InterruptedException e) {
s_logger.debug("[ignored] interupted while powering of vm.");
}
}
@ -321,6 +323,7 @@ public class VirtualMachineMO extends BaseMO {
try {
Thread.sleep(1000);
} catch (InterruptedException e) {
s_logger.debug("[ignored] interupted while powering of vm unconditionaly.");
}
}
return true;
@ -354,6 +357,7 @@ public class VirtualMachineMO extends BaseMO {
try {
Thread.sleep(1000);
} catch (InterruptedException e) {
s_logger.debug("[ignored] interupted while pausing after power off.");
}
} else {
break;
@ -477,6 +481,7 @@ public class VirtualMachineMO extends BaseMO {
try {
Thread.sleep(1000);
} catch (InterruptedException e) {
s_logger.debug("[ignored] interupted while waiting for snapshot to be done.");
}
}
@ -1405,6 +1410,7 @@ public class VirtualMachineMO extends BaseMO {
try {
Thread.sleep(1000);
} catch (InterruptedException e) {
s_logger.debug("[ignored] interupted while handling vm question about iso detach.");
}
}
s_logger.info("VM Question monitor stopped");
@ -2572,6 +2578,7 @@ public class VirtualMachineMO extends BaseMO {
try {
Thread.sleep(1000);
} catch (InterruptedException e) {
s_logger.debug("[ignored] interupted while handling vm question about umount tools install.");
}
}

View File

@ -632,6 +632,7 @@ public class VmwareContext {
try {
Thread.sleep(CONNECT_RETRY_INTERVAL);
} catch (InterruptedException ex) {
s_logger.debug("[ignored] interupted while connecting.");
}
}
}