Skip to content

Commit 329c6eb

Browse files
committed
Adding tracelogging to CitrixResourceBase xapi task handling.
Currently it is very hard to see which tasks are pending in cloudstack that need to be executed by xapi. Ideally we would like to have a central overview of all tasks centrally. But for now being able to enable tracelogging should give some insight in what is going on.
1 parent 3160a0c commit 329c6eb

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/CitrixResourceBase.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3721,8 +3721,14 @@ protected boolean isDmcEnabled(Connection conn, Host host) throws XenAPIExceptio
37213721

37223722
protected void waitForTask(Connection c, Task task, long pollInterval, long timeout) throws XenAPIException, XmlRpcException {
37233723
long beginTime = System.currentTimeMillis();
3724+
if (s_logger.isTraceEnabled()) {
3725+
s_logger.trace("Task " + task.getNameLabel(c) + " (" + task.getType(c) + ") sent to " + c.getSessionReference() + " is pending completion with a " + timeout + "ms timeout");
3726+
}
37243727
while (task.getStatus(c) == Types.TaskStatusType.PENDING) {
37253728
try {
3729+
if (s_logger.isTraceEnabled()) {
3730+
s_logger.trace("Task " + task.getNameLabel(c) + " (" + task.getType(c) + ") is pending, sleeping for " + pollInterval + "ms");
3731+
}
37263732
Thread.sleep(pollInterval);
37273733
} catch (InterruptedException e) {
37283734
}
@@ -3737,6 +3743,9 @@ protected void waitForTask(Connection c, Task task, long pollInterval, long time
37373743

37383744
protected void checkForSuccess(Connection c, Task task) throws XenAPIException, XmlRpcException {
37393745
if (task.getStatus(c) == Types.TaskStatusType.SUCCESS) {
3746+
if (s_logger.isTraceEnabled()) {
3747+
s_logger.trace("Task " + task.getNameLabel(c) + " (" + task.getType(c) + ") completed");
3748+
}
37403749
return;
37413750
} else {
37423751
String msg = "Task failed! Task record: " + task.getRecord(c);

0 commit comments

Comments
 (0)