From 3bf17ade7a21b41e80cc750c2d3b04078df73c07 Mon Sep 17 00:00:00 2001 From: Prasanna Kumar Kalever Date: Thu, 19 Aug 2021 11:53:15 +0530 Subject: [PATCH] doc: update code comments about available timeout options Adding some code comments to make them readable and easy to understand. Signed-off-by: Prasanna Kumar Kalever --- internal/rbd/rbd_attach.go | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/internal/rbd/rbd_attach.go b/internal/rbd/rbd_attach.go index 98d16979a..b855fa806 100644 --- a/internal/rbd/rbd_attach.go +++ b/internal/rbd/rbd_attach.go @@ -48,9 +48,16 @@ const ( rbdUnmapCmdNbdMissingMap = "rbd-nbd: %s is not mapped" rbdMapConnectionTimeout = "Connection timed out" - defaultNbdReAttachTimeout = 300 + defaultNbdReAttachTimeout = 300 /* in seconds */ - useNbdNetlink = "try-netlink" + // The default way of creating nbd devices via rbd-nbd is through the + // legacy ioctl interface, to take advantage of netlink features we + // should specify `try-netlink` flag explicitly. + useNbdNetlink = "try-netlink" + + // `reattach-timeout` of rbd-nbd is to tweak NBD_ATTR_DEAD_CONN_TIMEOUT. + // It specifies how long the device should be held waiting for the + // userspace process to come back to life. setNbdReattach = "reattach-timeout" )