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

NAS-130814 / 24.10-RC.1 / Add timeout to iscsi.target.logout_iqn (by bmeagherix) #14358

Merged
merged 1 commit into from
Aug 28, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/middlewared/middlewared/plugins/iscsi_/targets.py
Original file line number Diff line number Diff line change
Expand Up @@ -458,13 +458,13 @@ async def login_iqn(self, ip, iqn, no_wait=False):
raise OSError(cp.returncode, os.strerror(cp.returncode), err)

@private
async def logout_iqn(self, ip, iqn, no_wait=False):
async def logout_iqn(self, ip, iqn, no_wait=False, timeout=30):
cmd = ['iscsiadm', '-m', 'node', '-p', ip, '-T', iqn, '--logout']
if no_wait:
cmd.append('--no_wait')
err = f'LOGOUT: {ip!r} {iqn!r}'
try:
cp = await run(cmd, stderr=subprocess.STDOUT, encoding='utf-8')
cp = await run(cmd, stderr=subprocess.STDOUT, encoding='utf-8', timeout=timeout)
except Exception as e:
err += f' ERROR: {str(e)}'
raise UnexpectedFailure(err)
Expand Down
Loading