Skip to content

Commit 76b3367

Browse files
authored
Merge pull request ceph#44958 from rishabh-d-dave/qa-cephfs-timeout
qa/cephfs: change default timeout from 900 secs to 300 Reviewed-by: Venky Shankar <[email protected]>
2 parents 7bc93fc + ac5de47 commit 76b3367

File tree

4 files changed

+33
-26
lines changed

4 files changed

+33
-26
lines changed

qa/tasks/cephfs/filesystem.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@ def clear_ceph_conf(self, subsys, key):
250250

251251
def json_asok(self, command, service_type, service_id, timeout=None):
252252
if timeout is None:
253-
timeout = 15*60
253+
timeout = 300
254254
command.insert(0, '--format=json')
255255
proc = self.mon_manager.admin_socket(service_type, service_id, command, timeout=timeout)
256256
response_data = proc.stdout.getvalue().strip()

qa/tasks/cephfs/fuse_mount.py

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
from teuthology.orchestra import run
1111
from teuthology.exceptions import CommandFailedError
1212
from tasks.ceph_manager import get_valgrind_args
13-
from tasks.cephfs.mount import CephFSMount
13+
from tasks.cephfs.mount import CephFSMount, UMOUNT_TIMEOUT
1414

1515
log = logging.getLogger(__name__)
1616

@@ -146,7 +146,7 @@ def _list_fuse_conns(self):
146146
try:
147147
ls_str = self.client_remote.sh("ls " + conn_dir,
148148
stdout=StringIO(),
149-
timeout=(15*60)).strip()
149+
timeout=300).strip()
150150
except CommandFailedError:
151151
return []
152152

@@ -239,7 +239,7 @@ def check_mounted_state(self):
239239
stdout=StringIO(),
240240
stderr=StringIO(),
241241
wait=False,
242-
timeout=(15*60)
242+
timeout=300
243243
)
244244
try:
245245
proc.wait()
@@ -286,7 +286,7 @@ def wait_until_mounted(self):
286286
stderr = StringIO()
287287
self.client_remote.run(args=['sudo', 'chmod', '1777',
288288
self.hostfs_mntpt],
289-
timeout=(15*60),
289+
timeout=300,
290290
stderr=stderr, omit_sudo=False)
291291
break
292292
except run.CommandFailedError:
@@ -299,7 +299,9 @@ def wait_until_mounted(self):
299299
raise
300300

301301
def _mountpoint_exists(self):
302-
return self.client_remote.run(args=["ls", "-d", self.hostfs_mntpt], check_status=False, timeout=(15*60)).exitstatus == 0
302+
return self.client_remote.run(args=["ls", "-d", self.hostfs_mntpt],
303+
check_status=False,
304+
timeout=300).exitstatus == 0
303305

304306
def umount(self, cleanup=True):
305307
"""
@@ -314,10 +316,9 @@ def umount(self, cleanup=True):
314316
try:
315317
log.info('Running fusermount -u on {name}...'.format(name=self.client_remote.name))
316318
stderr = StringIO()
317-
self.client_remote.run(args=['sudo', 'fusermount', '-u',
318-
self.hostfs_mntpt],
319-
stderr=stderr,
320-
timeout=(30*60), omit_sudo=False)
319+
self.client_remote.run(
320+
args=['sudo', 'fusermount', '-u', self.hostfs_mntpt],
321+
stderr=stderr, timeout=UMOUNT_TIMEOUT, omit_sudo=False)
321322
except run.CommandFailedError:
322323
if "mountpoint not found" in stderr.getvalue():
323324
# This happens if the mount directory doesn't exist
@@ -331,7 +332,7 @@ def umount(self, cleanup=True):
331332
self.client_remote.run(
332333
args=['sudo', run.Raw('PATH=/usr/sbin:$PATH'), 'lsof',
333334
run.Raw(';'), 'ps', 'auxf'],
334-
timeout=(60*15), omit_sudo=False)
335+
timeout=UMOUNT_TIMEOUT, omit_sudo=False)
335336

336337
# abort the fuse mount, killing all hung processes
337338
if self._fuse_conn:
@@ -346,9 +347,9 @@ def umount(self, cleanup=True):
346347
stderr = StringIO()
347348
# make sure its unmounted
348349
try:
349-
self.client_remote.run(args=['sudo', 'umount', '-l', '-f',
350-
self.hostfs_mntpt],
351-
stderr=stderr, timeout=(60*15), omit_sudo=False)
350+
self.client_remote.run(
351+
args=['sudo', 'umount', '-l', '-f', self.hostfs_mntpt],
352+
stderr=stderr, timeout=UMOUNT_TIMEOUT, omit_sudo=False)
352353
except CommandFailedError:
353354
if self.is_mounted():
354355
raise
@@ -361,7 +362,8 @@ def umount(self, cleanup=True):
361362
if cleanup:
362363
self.cleanup()
363364

364-
def umount_wait(self, force=False, require_clean=False, timeout=900):
365+
def umount_wait(self, force=False, require_clean=False,
366+
timeout=UMOUNT_TIMEOUT):
365367
"""
366368
:param force: Complete cleanly even if the MDS is offline
367369
"""
@@ -475,7 +477,7 @@ def admin_socket(self, args):
475477
p = self.client_remote.run(args=
476478
['sudo', self._prefix + 'ceph', '--admin-daemon', asok_path] + args,
477479
stdout=StringIO(), stderr=StringIO(), wait=False,
478-
timeout=(15*60))
480+
timeout=300)
479481
p.wait()
480482
break
481483
except CommandFailedError:

qa/tasks/cephfs/kernel_mount.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,11 @@
1010
from teuthology.orchestra import run
1111
from teuthology.contextutil import MaxWhileTries
1212

13-
from tasks.cephfs.mount import CephFSMount
13+
from tasks.cephfs.mount import CephFSMount, UMOUNT_TIMEOUT
1414

1515
log = logging.getLogger(__name__)
1616

1717

18-
UMOUNT_TIMEOUT = 300
1918
# internal metadata directory
2019
DEBUGFS_META_DIR = 'meta'
2120

@@ -70,7 +69,7 @@ def _run_mount_cmd(self, mntopts, check_status):
7069
mountcmd_stdout, mountcmd_stderr = StringIO(), StringIO()
7170

7271
try:
73-
self.client_remote.run(args=mount_cmd, timeout=(30*60),
72+
self.client_remote.run(args=mount_cmd, timeout=300,
7473
stdout=mountcmd_stdout,
7574
stderr=mountcmd_stderr, omit_sudo=False)
7675
except CommandFailedError as e:
@@ -136,13 +135,13 @@ def umount(self, force=False):
136135
cmd=['sudo', 'umount', self.hostfs_mntpt]
137136
if force:
138137
cmd.append('-f')
139-
self.client_remote.run(args=cmd, timeout=(15*60), omit_sudo=False)
138+
self.client_remote.run(args=cmd, timeout=UMOUNT_TIMEOUT, omit_sudo=False)
140139
except Exception as e:
141140
log.debug('Killing processes on client.{id}...'.format(id=self.client_id))
142141
self.client_remote.run(
143142
args=['sudo', run.Raw('PATH=/usr/sbin:$PATH'), 'lsof',
144143
run.Raw(';'), 'ps', 'auxf'],
145-
timeout=(15*60), omit_sudo=False)
144+
timeout=UMOUNT_TIMEOUT, omit_sudo=False)
146145
raise e
147146

148147
if self.dynamic_debug:
@@ -155,7 +154,8 @@ def umount(self, force=False):
155154
self.mounted = False
156155
self.cleanup()
157156

158-
def umount_wait(self, force=False, require_clean=False, timeout=900):
157+
def umount_wait(self, force=False, require_clean=False,
158+
timeout=UMOUNT_TIMEOUT):
159159
"""
160160
Unlike the fuse client, the kernel client's umount is immediate
161161
"""
@@ -172,8 +172,8 @@ def umount_wait(self, force=False, require_clean=False, timeout=900):
172172
# force delete the netns and umount
173173
log.debug('Force/lazy unmounting on client.{id}...'.format(id=self.client_id))
174174
self.client_remote.run(args=['sudo', 'umount', '-f', '-l',
175-
self.mountpoint],
176-
timeout=(15*60), omit_sudo=False)
175+
self.mountpoint], timeout=timeout,
176+
omit_sudo=False)
177177

178178
self.mounted = False
179179
self.cleanup()

qa/tasks/cephfs/mount.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,10 @@
2121

2222
log = logging.getLogger(__name__)
2323

24+
25+
UMOUNT_TIMEOUT = 300
26+
27+
2428
class CephFSMount(object):
2529
def __init__(self, ctx, test_dir, client_id, client_remote,
2630
client_keyring_path=None, hostfs_mntpt=None,
@@ -452,7 +456,8 @@ def mount_wait(self, **kwargs):
452456
def umount(self):
453457
raise NotImplementedError()
454458

455-
def umount_wait(self, force=False, require_clean=False, timeout=None):
459+
def umount_wait(self, force=False, require_clean=False,
460+
timeout=UMOUNT_TIMEOUT):
456461
"""
457462
458463
:param force: Expect that the mount will not shutdown cleanly: kill
@@ -695,7 +700,7 @@ def run_python(self, pyscript, py_version='python3', sudo=False):
695700
p.wait()
696701
return p.stdout.getvalue().strip()
697702

698-
def run_shell(self, args, timeout=900, **kwargs):
703+
def run_shell(self, args, timeout=300, **kwargs):
699704
args = args.split() if isinstance(args, str) else args
700705
kwargs.pop('omit_sudo', False)
701706
sudo = kwargs.pop('sudo', False)

0 commit comments

Comments
 (0)