Bug 167973

Summary: iscsi reload can hang during "iscsi-rescan" if targets are unreachable
Product: Red Hat Enterprise Linux 4 Reporter: Dave Wysochanski <davidw>
Component: iscsi-initiator-utilsAssignee: Mike Christie <mchristi>
Status: CLOSED ERRATA QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: 4.0CC: coughlan, davidw
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: RHBA-2006-0495 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2006-08-10 21:53:41 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 181409    
Attachments:
Description Flags
iscsi-kill-session none

Description Dave Wysochanski 2005-09-09 21:26:31 UTC
Description of problem:

If any targets are unreachable, and you try an "iscsi reload", the command will
hang indefinately.  

I came up with another simple script that issues the kill session command, and
seems to work ok in the session hangs I found.  I'll attach the script and let
you all decide whether you think this is ok to include or not - seems to meet my
needs but you may have issues with including it.  Also, for this particular
problem, there may be other more elegant solutions but I thought the simple
script was worth mentioning since it solved my problems.

Note that the README states how to shutdown sessions (see below), but having a
simple utility do it seems worth considering.

  Note that any configuration changes will not affect existing target sessions.
  For example, removal of a DiscoveryAddress entry from /etc/iscsi.conf
  will not cause the removal of sessions to targets discovered through this
  DiscoveryAddress, but it will cause the removal of the discovery session
  corresponding to the deleted DiscoveryAddress.
  To remove these sessions execute the following for each of these sessions:
  - Set ConnFailTimeout, ResetTimeout and AbortTimeout on the session to a low
    value, like 5 seconds through sysfs by executing the following commands:
    echo 5 > /sys/class/scsi_host/host<host_no>/connfail_timeout
    echo 5 > /sys/class/scsi_host/host<host_no>/reset_timeout
    echo 5 > /sys/class/scsi_host/host<host_no>/abort_timeout
  - Stop IOs to all the devices discovered through the session.
  - If these devices have been mounted, unmount them.
  - Shutdown the session through sysfs by executing the following command:
    echo > /sys/class/scsi_host/host<host_no>/shutdown
    where <host_no> is the Host Number of the session that has to be removed.



Version-Release number of selected component (if applicable):
iscsi-initiator-utils-4.0.3.0-2

How reproducible:
Every time

Steps to Reproduce:
1. Enter DiscoveryAddress=IP1 into /etc/iscsi.conf
2. /etc/init.d/iscsi start
3. Add DiscoveryAddress=IP2 in /etc/iscsi.conf
4. Somehow make target on IP1 unreachable (pull cable, stop iscsi on target
side, etc)
5. /etc/init.d/iscsi reload *command hang*
  
Actual results:
"/etc/init.d/iscsi reload" hangs indefinately

Expected results:
"/etc/init.d/iscsi reload" should not hang indefinately

Additional info:

Comment 1 Dave Wysochanski 2005-09-09 21:26:32 UTC
Created attachment 118667 [details]
iscsi-kill-session

Comment 2 Dave Wysochanski 2005-09-09 21:30:04 UTC

*** This bug has been marked as a duplicate of 167946 ***

Comment 3 Mike Christie 2006-01-28 23:26:24 UTC
This bug is to add the iscsi-kill-session script created by Netapp to U4. This
is a dulpicate of BZ 167946, but for that BZ we did a fix for the rescan part in
U3. This bug is to get the second part of the fix into U4.

Comment 8 Red Hat Bugzilla 2006-08-10 21:53:41 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on the solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHBA-2006-0495.html