On 10/25/2010 07:52 PM, Eddie Wai wrote:
The race condition can be observed with the following sequence of events:
- For every active sessions, issue an ISCSI_ERR_CONN_FAILED nl msg
(This will eventually put all active connections into the actor_list ready
to execute the session_conn_reopen procedure)
- Asynchronously after a few seconds, call the iscsi_host_remove procedure
(This will notify iscsid with the ISCSI_ERR_INVALID_HOST nl message)

The current code actually handles this by advancing the INVALID_HOST
session_conn_error actor scheduing to the head via the actor_schedule_head
procedure.  However, if the current actor thread was call-backed from the
actor_poll loop, then this head scheduling will actually put the INVALID_HOST
actor onto the poll_list instead of the actor_list.

If there are subsequent elements in the actor_list which triggers the reopen
path, then the conn_context for the INVALID_HOST for that particular
connection will get flushed (+ actor_delete).  This will then lockup the
libiscsi's iscsi_host_remove call as it will wait indefinitely on all
sessions to be removed.

The fix is to put this head scheduling to the head of the actor_list
regardless of poll mode or not.  This will allow all INVALID_PATH actors
to have a chance to get executed before any subsequent reopen actors.


Patch and explanation make sense. I just cannot figure out the code path that causes us to get the INVALID PATH scheduled from a actor callback.

I think when I wrote the code and when I just re-tested it, we went from event_loop->ctldev_handle->iscsi_sched_conn_context of the INVALID_PATH handling. So we never came through actor_poll.

Is this happening with the discovery offload passthrough patches by any chance?

--
You received this message because you are subscribed to the Google Groups 
"open-iscsi" group.
To post to this group, send email to open-is...@googlegroups.com.
To unsubscribe from this group, send email to 
open-iscsi+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/open-iscsi?hl=en.

Reply via email to