Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UB-1407: added timeouts to umount operations #237

Merged
merged 4 commits into from
Aug 23, 2018

Conversation

olgashtivelman
Copy link
Collaborator

@olgashtivelman olgashtivelman commented Aug 16, 2018

added timeout to some commands as part of the unmount process as follows:

unmount (timeout 30s)
clean up command : dmsetup and multipath -f (each should be with timeout of 30s)
multipath -ll (timeout 20s)
multipath -r (timeout 60s)
rescan -r (timeout 2 minutes)
iscsiadm rescan (timeout 1 minutes)


This change is Reviewable

@coveralls
Copy link

coveralls commented Aug 16, 2018

Coverage Status

Coverage increased (+3.8%) to 51.961% when pulling f7fadb9 on fix/UB-1407_add_timeout_to_commands into 382fc6e on dev.

@beckmani
Copy link
Contributor


remote/mounter/block_device_utils/fs.go, line 95 at r1 (raw file):

	args := []string{mpoint}
	if _, err := b.exec.ExecuteWithTimeout(30*1000, umountCmd, args); err != nil {

Please define as const (umountTimeout) - see MultipathTimeout in mpath.go

@beckmani
Copy link
Contributor


remote/mounter/block_device_utils/mpath.go, line 30 at r1 (raw file):

const multipathCmd = "multipath"
const MultipathTimeout = 60*1000

Nice :-)

@beckmani
Copy link
Contributor


remote/mounter/block_device_utils/mpath.go, line 60 at r1 (raw file):

	}
	args := []string{"-ll"}
	outputBytes, err := b.exec.ExecuteWithTimeout(20*1000, multipathCmd, args)

Should use MultipathTimeout

@beckmani
Copy link
Contributor


remote/mounter/block_device_utils/mpath.go, line 234 at r1 (raw file):

func (b *blockDeviceUtils) Cleanup(mpath string) error {
	defer b.logger.Trace(logs.DEBUG)()
	cleanupTimeout := 30*1000

Should be defined as const

@beckmani
Copy link
Contributor


remote/mounter/block_device_utils/rescan.go, line 44 at r1 (raw file):

	}
	args := []string{"-m", "session", "--rescan"}
	if _, err := b.exec.ExecuteWithTimeout(1*60*1000, rescanCmd, args); err != nil {

Should be defined as const

Copy link
Contributor

@beckmani beckmani left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed 4 of 4 files at r1.
Reviewable status: all files reviewed, 5 unresolved discussions (waiting on @olgashtivelman and @shay-berman)

Copy link
Collaborator Author

@olgashtivelman olgashtivelman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: 1 of 4 files reviewed, 5 unresolved discussions (waiting on @beckmani, @olgashtivelman, and @shay-berman)


remote/mounter/block_device_utils/fs.go, line 95 at r1 (raw file):

Previously, beckmani (Isaac Beckman) wrote…

Please define as const (umountTimeout) - see MultipathTimeout in mpath.go

I defined const for numbers used more then once otherwise i just think its just abit of an overkill
but sure i will change it...


remote/mounter/block_device_utils/mpath.go, line 30 at r1 (raw file):

Previously, beckmani (Isaac Beckman) wrote…

Nice :-)

Done.


remote/mounter/block_device_utils/mpath.go, line 60 at r1 (raw file):

Previously, beckmani (Isaac Beckman) wrote…

Should use MultipathTimeout

Done.


remote/mounter/block_device_utils/mpath.go, line 234 at r1 (raw file):

Previously, beckmani (Isaac Beckman) wrote…

Should be defined as const

Done.


remote/mounter/block_device_utils/rescan.go, line 44 at r1 (raw file):

Previously, beckmani (Isaac Beckman) wrote…

Should be defined as const

Done.

Copy link
Contributor

@shay-berman shay-berman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: 1 of 4 files reviewed, 8 unresolved discussions (waiting on @beckmani and @olgashtivelman)


remote/mounter/block_device_utils/block_device_utils_test.go, line 642 at r2 (raw file):

			Expect(cmd).To(Equal("mount")) // second check is the umount
		})
		It("UmountFs fails if umount command missing", func() {

please add a test that will simulate timeout reached. at least for one command line.
So you will cover it as well in unit testing.


remote/mounter/block_device_utils/fs.go, line 34 at r2 (raw file):

	TimeoutMilisecondMountCmdIsDeviceMounted = 20 * 1000     // max to wait for mount command
	TimeoutMilisecondMountCmdMountFs         = 120 * 1000    // max to wait for mounting device
	UmountFsTimeout                          = 30 * 1000

please continue the terminolagy of the const name - TimeoutMilisecondUnmountFs and also add short comment please.
thanks


remote/mounter/block_device_utils/mpath.go, line 32 at r2 (raw file):

const multipathCmd = "multipath"
const MultipathTimeout = 60 * 1000
const Discovertimeout = 20 * 1000

small typo - try to use T capital.

@shay-berman
Copy link
Contributor

@olgashtivelman finished to review - please apply few comments and then it LGTM

Copy link
Collaborator Author

@olgashtivelman olgashtivelman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: 1 of 4 files reviewed, 8 unresolved discussions (waiting on @beckmani and @shay-berman)


remote/mounter/block_device_utils/block_device_utils_test.go, line 642 at r2 (raw file):

Previously, shay-berman wrote…

please add a test that will simulate timeout reached. at least for one command line.
So you will cover it as well in unit testing.

Done.


remote/mounter/block_device_utils/fs.go, line 34 at r2 (raw file):

Previously, shay-berman wrote…

please continue the terminolagy of the const name - TimeoutMilisecondUnmountFs and also add short comment please.
thanks

Done.


remote/mounter/block_device_utils/mpath.go, line 32 at r2 (raw file):

Previously, shay-berman wrote…

small typo - try to use T capital.

Done.

Copy link
Contributor

@shay-berman shay-berman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:lgtm:

Reviewable status: 0 of 4 files reviewed, 5 unresolved discussions (waiting on @beckmani)

@olgashtivelman olgashtivelman merged commit 01b6871 into dev Aug 23, 2018
@olgashtivelman olgashtivelman deleted the fix/UB-1407_add_timeout_to_commands branch August 23, 2018 12:20
@shay-berman shay-berman added the idempotency Improve Flex API idempotency aspects label Aug 27, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
idempotency Improve Flex API idempotency aspects
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants