Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions agent/src/com/cloud/agent/AgentShell.java
Original file line number Diff line number Diff line change
Expand Up @@ -464,6 +464,7 @@ public void start() {
while (!_exit)
Thread.sleep(1000);
} catch (InterruptedException e) {
s_logger.debug("[ignored] AgentShell was interupted.");
}

} catch (final ConfigurationException e) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,32 +70,6 @@ public String getPassword() {
};
}

/*
* @Test public void testExecuteVpnUserNotFound() {
*
* EntityManager entityManager = Mockito.mock(EntityManager.class);
*
* Mockito.when(entityManager.findById(VpnUser.class,
* Mockito.anyLong())).thenReturn(null);
*
* addVpnUserCmd._entityMgr = entityManager; try { addVpnUserCmd.execute();
* } catch (Exception e) { }
*
* }
*
*
* @Test public void testExecuteVpnUserFound() {
*
* EntityManager entityManager = Mockito.mock(EntityManager.class);
* addVpnUserCmd._entityMgr = entityManager;
*
* VpnUser vpnUser = Mockito.mock(VpnUser.class);
* Mockito.when(entityManager.findById(VpnUser.class,
* Mockito.anyLong())).thenReturn(vpnUser); addVpnUserCmd.execute();
*
* }
*/

@Test
public void testCreateSuccess() {

Expand Down
3 changes: 2 additions & 1 deletion core/src/com/cloud/storage/template/OVAProcessor.java
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,8 @@ public long getVirtualSize(File file) {
long size = getTemplateVirtualSize(file.getParent(), file.getName());
return size;
} catch (Exception e) {

s_logger.info("[ignored]"
+ "failed to get virtual template size for ova: " + e.getLocalizedMessage());
}
return file.length();
}
Expand Down
3 changes: 2 additions & 1 deletion core/src/com/cloud/storage/template/VmdkProcessor.java
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,8 @@ public long getVirtualSize(File file) {
long size = getTemplateVirtualSize(file.getParent(), file.getName());
return size;
} catch (Exception e) {

s_logger.info("[ignored]"
+ "failed to get template virtual size for vmdk: " + e.getLocalizedMessage());
}
return file.length();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -483,6 +483,8 @@ public SocketChannel connectToPeer(String peerName, SocketChannel prevCh) {
try {
prevCh.close();
} catch (Exception e) {
s_logger.info("[ignored]"
+ "failed to get close resource for previous channel Socket: " + e.getLocalizedMessage());
}
}
if (ch == null || ch == prevCh) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -611,7 +611,10 @@ public List<RunningHostCountInfo> getRunningHostCounts(Date cutTime) {
l.add(info);
}
} catch (SQLException e) {
s_logger.error("sql exception while getting running hosts: " + e.getLocalizedMessage());
} catch (Throwable e) {
s_logger.info("[ignored]"
+ "caught something while getting running hosts: " + e.getLocalizedMessage());
}
return l;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ private int executeWithRetryOnDeadlock(TransactionLegacy txn, String pstmt, List
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");
Expand Down
10 changes: 6 additions & 4 deletions engine/schema/src/com/cloud/storage/dao/SnapshotDaoImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,12 @@
import com.cloud.utils.db.Filter;
import com.cloud.utils.db.GenericDaoBase;
import com.cloud.utils.db.GenericSearchBuilder;
import com.cloud.utils.db.UpdateBuilder;
import com.cloud.utils.db.JoinBuilder.JoinType;
import com.cloud.utils.db.SearchBuilder;
import com.cloud.utils.db.SearchCriteria;
import com.cloud.utils.db.SearchCriteria.Func;
import com.cloud.utils.db.TransactionLegacy;
import com.cloud.utils.db.UpdateBuilder;
import com.cloud.vm.VMInstanceVO;
import com.cloud.vm.dao.VMInstanceDao;

Expand Down Expand Up @@ -208,6 +208,8 @@ public Long getSecHostId(long volumeId) {
return rs.getLong(1);
}
} catch (Exception ex) {
s_logger.info("[ignored]"
+ "caught something while getting sec. host id: " + ex.getLocalizedMessage());
}
return null;
}
Expand Down Expand Up @@ -276,7 +278,7 @@ public Long countSnapshotsForAccount(long accountId) {

@Override
public List<SnapshotVO> listByInstanceId(long instanceId, Snapshot.State... status) {
SearchCriteria<SnapshotVO> sc = this.InstanceIdSearch.create();
SearchCriteria<SnapshotVO> sc = InstanceIdSearch.create();

if (status != null && status.length != 0) {
sc.setParameters("status", (Object[])status);
Expand All @@ -289,7 +291,7 @@ public List<SnapshotVO> listByInstanceId(long instanceId, Snapshot.State... stat

@Override
public List<SnapshotVO> listByStatus(long volumeId, Snapshot.State... status) {
SearchCriteria<SnapshotVO> sc = this.StatusSearch.create();
SearchCriteria<SnapshotVO> sc = StatusSearch.create();
sc.setParameters("volumeId", volumeId);
sc.setParameters("status", (Object[])status);
return listBy(sc, null);
Expand All @@ -311,7 +313,7 @@ public boolean remove(Long id) {

@Override
public List<SnapshotVO> listAllByStatus(Snapshot.State... status) {
SearchCriteria<SnapshotVO> sc = this.StatusSearch.create();
SearchCriteria<SnapshotVO> sc = StatusSearch.create();
sc.setParameters("status", (Object[])status);
return listBy(sc, null);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,9 @@ public DataObject createCacheObject(DataObject data, DataStore store) {
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();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,7 @@ protected void runInContext() {
try {
Thread.sleep(1000);
} catch (InterruptedException e1) {
s_logger.debug("[ignored] interupted while waiting to retry running the servlet container.");
}
}
}
Expand Down
1 change: 1 addition & 0 deletions framework/db/src/com/cloud/utils/db/Merovingian2.java
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@ public boolean acquire(String key, int timeInSeconds) {
}
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";
Expand Down
1 change: 1 addition & 0 deletions framework/db/test/com/cloud/utils/db/GlobalLockTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ public void run() {
Thread.sleep(jobDuration * 1000);
}
} catch (InterruptedException e) {
s_logger.debug("[ignored] interupted while testing global lock.");
} finally {
if (locked) {
boolean unlocked = WorkLock.unlock();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

import org.apache.log4j.Logger;

import org.apache.cloudstack.framework.serializer.MessageSerializer;
import org.apache.cloudstack.framework.transport.TransportEndpoint;
import org.apache.cloudstack.framework.transport.TransportEndpointSite;
Expand All @@ -32,10 +34,11 @@
import com.cloud.utils.concurrency.NamedThreadFactory;

public class ClientTransportProvider implements TransportProvider {
final static Logger s_logger = Logger.getLogger(ClientTransportProvider.class);
public static final int DEFAULT_WORKER_POOL_SIZE = 5;

private Map<Integer, ClientTransportEndpointSite> _endpointSites = new HashMap<Integer, ClientTransportEndpointSite>();
private Map<String, ClientTransportEndpointSite> _attachedMap = new HashMap<String, ClientTransportEndpointSite>();
private final Map<Integer, ClientTransportEndpointSite> _endpointSites = new HashMap<Integer, ClientTransportEndpointSite>();
private final Map<String, ClientTransportEndpointSite> _attachedMap = new HashMap<String, ClientTransportEndpointSite>();

private MessageSerializer _messageSerializer;

Expand Down Expand Up @@ -69,6 +72,8 @@ protected void runInContext() {
try {
_connection.connect(_serverAddress, _serverPort);
} catch (Throwable e) {
s_logger.info("[ignored]"
+ "error during ipc client initialization: " + e.getLocalizedMessage());
}
}
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -326,6 +326,7 @@ public boolean enter(boolean wait) {
try {
wait();
} catch (InterruptedException e) {
s_logger.debug("[ignored] interupted while guarding re-entrance on message bus.");
}
} else {
break;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ public void waitAny(long timeoutInMiliseconds) {
try {
wait(timeoutInMiliseconds);
} catch (InterruptedException e) {
s_logger.debug("[ignored] interupted while waiting on any message.");
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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] .");
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,21 +22,22 @@

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;
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;
Expand Down Expand Up @@ -128,6 +129,7 @@ public void run() {
try {
Thread.sleep(3000);
} catch (InterruptedException e) {
s_logger.debug("[ignored] .");
}
_messageBus.publish(null, "Host", PublishScope.GLOBAL, null);
}
Expand All @@ -148,6 +150,7 @@ public void run() {
try {
thread.join();
} catch (InterruptedException e) {
s_logger.debug("[ignored] .");
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import java.sql.SQLException;
import java.util.Date;
import java.util.List;

import javax.annotation.PostConstruct;
import javax.inject.Inject;

Expand Down Expand Up @@ -166,25 +167,35 @@ public void expungeLeftoverWorkJobs(final long msid) {
public void doInTransactionWithoutResult(TransactionStatus status) {
TransactionLegacy txn = TransactionLegacy.currentTxn();

PreparedStatement pstmt = null;
try {
pstmt = txn.prepareAutoCloseStatement(
try (
PreparedStatement pstmt = txn
.prepareAutoCloseStatement(
"DELETE FROM vm_work_job WHERE id IN (SELECT id FROM async_job WHERE (job_dispatcher='VmWorkJobPlaceHolder' OR job_dispatcher='VmWorkJobDispatcher') AND job_init_msid=?)");
) {
pstmt.setLong(1, msid);

pstmt.execute();
} catch (SQLException e) {
s_logger.info("[ignored]"
+ "SQL failed to delete vm work job: " + e.getLocalizedMessage());
} catch (Throwable e) {
s_logger.info("[ignored]"
+ "caught an error during delete vm work job: " + e.getLocalizedMessage());
}

try {
pstmt = txn.prepareAutoCloseStatement(
try (
PreparedStatement pstmt = txn.prepareAutoCloseStatement(
"DELETE FROM async_job WHERE (job_dispatcher='VmWorkJobPlaceHolder' OR job_dispatcher='VmWorkJobDispatcher') AND job_init_msid=?");
) {
pstmt.setLong(1, msid);

pstmt.execute();
} catch (SQLException e) {
s_logger.info("[ignored]"
+ "SQL failed to delete async job: " + e.getLocalizedMessage());
} catch (Throwable e) {
s_logger.info("[ignored]"
+ "caught an error during delete async job: " + e.getLocalizedMessage());
}
}
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ public void run() {
try {
Thread.sleep(3000);
} catch (InterruptedException e) {
s_logger.debug("[ignored] .");
}

s_logger.info("wakeup");
Expand Down Expand Up @@ -119,6 +120,7 @@ public void test() {
try {
Thread.sleep(1000);
} catch (InterruptedException e) {
s_logger.debug("[ignored] .");
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ public void runJob(final AsyncJob job) {
try {
Thread.sleep(interval);
} catch (InterruptedException e) {
s_logger.debug("[ignored] .");
}

_asyncJobMgr.completeAsyncJob(job.getId(), Status.SUCCEEDED, 0, null);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,16 @@
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;
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() {
}
Expand Down Expand Up @@ -91,6 +94,7 @@ public ConnectionImpl pickConnection(LoadBalancingConnectionProxy proxy, List<St
try {
Thread.sleep(250);
} catch (InterruptedException e) {
s_logger.debug("[ignored] interupted while fail over in progres.");
}

// start fresh
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -303,6 +303,7 @@ protected boolean doScript(Script cmd, OutputInterpreter interpreter, int retry)
try {
TimeUnit.SECONDS.sleep(1);
} catch (InterruptedException e) {
s_logger.debug("[ignored] interupted while waiting to retry running script.");
}
continue;
} else if (res == null) {
Expand Down
Loading