logs: use context logger in node driver
This commit is contained in:
parent
7e78977c83
commit
3ec110a7d9
|
|
@ -944,7 +944,7 @@ class CsiBaseDriver {
|
|||
|
||||
let current_time = Math.round(new Date().getTime() / 1000);
|
||||
if (!result && current_time - timer_start > timer_max) {
|
||||
driver.ctx.logger.warn(
|
||||
callContext.logger.warn(
|
||||
`hit timeout waiting for device node to appear: ${device}`
|
||||
);
|
||||
break;
|
||||
|
|
@ -955,7 +955,7 @@ class CsiBaseDriver {
|
|||
device = await filesystem.realpath(device);
|
||||
iscsiDevices.push(device);
|
||||
|
||||
driver.ctx.logger.info(
|
||||
callContext.logger.info(
|
||||
`successfully logged into portal ${iscsiConnection.portal} and created device ${deviceByPath} with realpath ${device}`
|
||||
);
|
||||
}
|
||||
|
|
@ -979,7 +979,7 @@ class CsiBaseDriver {
|
|||
}
|
||||
|
||||
if (iscsiDevices.length != iscsiConnections.length) {
|
||||
driver.ctx.logger.warn(
|
||||
callContext.logger.warn(
|
||||
`failed to attach all iscsi devices/targets/portals`
|
||||
);
|
||||
|
||||
|
|
@ -1061,7 +1061,7 @@ class CsiBaseDriver {
|
|||
);
|
||||
});
|
||||
} catch (err) {
|
||||
driver.ctx.logger.warn(
|
||||
callContext.logger.warn(
|
||||
`error: ${JSON.stringify(err)} connecting to transport: ${
|
||||
nvmeofConnection.transport
|
||||
}`
|
||||
|
|
@ -1085,7 +1085,7 @@ class CsiBaseDriver {
|
|||
}
|
||||
});
|
||||
} catch (err) {
|
||||
driver.ctx.logger.warn(
|
||||
callContext.logger.warn(
|
||||
`error finding nvme controller device: ${JSON.stringify(
|
||||
err
|
||||
)}`
|
||||
|
|
@ -1112,7 +1112,7 @@ class CsiBaseDriver {
|
|||
}
|
||||
});
|
||||
} catch (err) {
|
||||
driver.ctx.logger.warn(
|
||||
callContext.logger.warn(
|
||||
`error finding nvme namespace device: ${JSON.stringify(
|
||||
err
|
||||
)}`
|
||||
|
|
@ -1146,7 +1146,7 @@ class CsiBaseDriver {
|
|||
|
||||
let current_time = Math.round(new Date().getTime() / 1000);
|
||||
if (!result && current_time - timer_start > timer_max) {
|
||||
driver.ctx.logger.warn(
|
||||
callContext.logger.warn(
|
||||
`hit timeout waiting for namespace device node to appear: ${namespaceDevice}`
|
||||
);
|
||||
break;
|
||||
|
|
@ -1158,7 +1158,7 @@ class CsiBaseDriver {
|
|||
nvmeofControllerDevices.push(controllerDevice);
|
||||
nvmeofNamespaceDevices.push(namespaceDevice);
|
||||
|
||||
driver.ctx.logger.info(
|
||||
callContext.logger.info(
|
||||
`successfully logged into nvmeof transport ${nvmeofConnection.transport} and created controller device: ${controllerDevice}, namespace device: ${namespaceDevice}`
|
||||
);
|
||||
}
|
||||
|
|
@ -1190,7 +1190,7 @@ class CsiBaseDriver {
|
|||
}
|
||||
|
||||
if (nvmeofControllerDevices.length != nvmeofConnections.length) {
|
||||
driver.ctx.logger.warn(
|
||||
callContext.logger.warn(
|
||||
`failed to attach all nvmeof devices/subsystems/transports`
|
||||
);
|
||||
|
||||
|
|
@ -1452,7 +1452,7 @@ class CsiBaseDriver {
|
|||
// data partion MUST be the last partition on the drive
|
||||
// to properly support expand/resize operations
|
||||
device = await filesystem.getBlockDeviceLastPartition(device);
|
||||
driver.ctx.logger.debug(
|
||||
callContext.logger.debug(
|
||||
`device has partitions, mount device is: ${device}`
|
||||
);
|
||||
|
||||
|
|
@ -1623,7 +1623,7 @@ class CsiBaseDriver {
|
|||
err.stdout.includes("find valid filesystem superblock") &&
|
||||
err.stderr.includes("checksum does not match superblock")
|
||||
) {
|
||||
driver.ctx.logger.warn(
|
||||
callContext.logger.warn(
|
||||
`successful mount, unsuccessful fs resize: attempting abnormal umount/mount/resize2fs to clear things up ${staging_target_path} (${device})`
|
||||
);
|
||||
|
||||
|
|
@ -1846,7 +1846,7 @@ class CsiBaseDriver {
|
|||
target_port
|
||||
);
|
||||
} catch (e) {
|
||||
driver.ctx.logger.warn(
|
||||
callContext.logger.warn(
|
||||
`failed adding target portal: ${JSON.stringify(
|
||||
iscsiConnection
|
||||
)}: ${e.stderr}`
|
||||
|
|
@ -1927,7 +1927,7 @@ class CsiBaseDriver {
|
|||
"The target has already been logged in via an iSCSI session"
|
||||
)
|
||||
) {
|
||||
driver.ctx.logger.warn(
|
||||
callContext.logger.warn(
|
||||
`failed connection to ${JSON.stringify(
|
||||
iscsiConnection
|
||||
)}: ${e.stderr}`
|
||||
|
|
@ -1946,7 +1946,7 @@ class CsiBaseDriver {
|
|||
}
|
||||
|
||||
if (iscsiConnections.length != successful_logins) {
|
||||
driver.ctx.logger.warn(
|
||||
callContext.logger.warn(
|
||||
`failed to login to all portals: total - ${iscsiConnections.length}, logins - ${successful_logins}`
|
||||
);
|
||||
}
|
||||
|
|
@ -2481,7 +2481,7 @@ class CsiBaseDriver {
|
|||
* AND the fs is probably stalled
|
||||
*/
|
||||
if (err.timeout) {
|
||||
driver.ctx.logger.warn(
|
||||
callContext.logger.warn(
|
||||
`detected stale mount, attempting to force unmount: ${normalized_staging_path}`
|
||||
);
|
||||
await mount.umount(
|
||||
|
|
@ -2531,14 +2531,14 @@ class CsiBaseDriver {
|
|||
);
|
||||
} catch (err) {
|
||||
if (err.timeout) {
|
||||
driver.ctx.logger.warn(
|
||||
callContext.logger.warn(
|
||||
`hit timeout waiting to unmount path: ${normalized_staging_path}`
|
||||
);
|
||||
result = await mount.getMountDetails(normalized_staging_path);
|
||||
switch (result.fstype) {
|
||||
case "nfs":
|
||||
case "nfs4":
|
||||
driver.ctx.logger.warn(
|
||||
callContext.logger.warn(
|
||||
`detected stale nfs filesystem, attempting to force unmount: ${normalized_staging_path}`
|
||||
);
|
||||
result = await mount.umount(
|
||||
|
|
@ -3316,7 +3316,7 @@ class CsiBaseDriver {
|
|||
// the only time this should timeout is on a stale fs
|
||||
// so if timeout is hit we should be near certain it is indeed mounted
|
||||
if (err.timeout) {
|
||||
driver.ctx.logger.warn(
|
||||
callContext.logger.warn(
|
||||
`detected stale mount, attempting to force unmount: ${target_path}`
|
||||
);
|
||||
await mount.umount(
|
||||
|
|
@ -3348,7 +3348,7 @@ class CsiBaseDriver {
|
|||
);
|
||||
} catch (err) {
|
||||
if (err.timeout) {
|
||||
driver.ctx.logger.warn(
|
||||
callContext.logger.warn(
|
||||
`hit timeout waiting to unmount path: ${target_path}`
|
||||
);
|
||||
// bind mounts do show the 'real' fs details
|
||||
|
|
@ -3356,7 +3356,7 @@ class CsiBaseDriver {
|
|||
switch (result.fstype) {
|
||||
case "nfs":
|
||||
case "nfs4":
|
||||
driver.ctx.logger.warn(
|
||||
callContext.logger.warn(
|
||||
`detected stale nfs filesystem, attempting to force unmount: ${target_path}`
|
||||
);
|
||||
result = await mount.umount(
|
||||
|
|
@ -3536,7 +3536,7 @@ class CsiBaseDriver {
|
|||
});
|
||||
}
|
||||
} catch (err) {
|
||||
driver.ctx.logger.debug("failed to retrieve inode info", err);
|
||||
callContext.logger.debug("failed to retrieve inode info", err);
|
||||
}
|
||||
break;
|
||||
case "block":
|
||||
|
|
@ -3954,7 +3954,7 @@ class CsiBaseDriver {
|
|||
* TODO: possibly change this to a percentage instead of absolute numbers
|
||||
*/
|
||||
let max_delta = 104857600;
|
||||
driver.ctx.logger.debug(
|
||||
callContext.logger.debug(
|
||||
"resize diff %s (%s%%)",
|
||||
diff,
|
||||
percentage_diff
|
||||
|
|
|
|||
Loading…
Reference in New Issue