[stgt] [PATCH] protect again tgtd process hang as of hanging redirect script
FUJITA Tomonori
fujita.tomonori at lab.ntt.co.jp
Sun Feb 27 06:05:09 CET 2011
On Thu, 24 Feb 2011 10:14:45 +0200
Or Gerlitz <ogerlitz at voltaire.com> wrote:
> FUJITA Tomonori wrote:
> > The description looks fine but it would be better to put the fd to
> > epoll (that is, using tgt_event_add)?
>
> yes, tgt_event_add would be more elegant way to handle that.
>
> One thing which exists with the current patch but wouldn't be possible
> by just using tgt_event_add is --limiting-- the time tgt is willing
> to allow the cluster management software to actually return something
> on the redirect callback invocation.
>
> So my plan is to use tgt_event_add so the redirect pipe fd is added to
> the epoll set, and also set a limit on the time tgt will be willing to
> wait for that reply by using the new timer-based work scheduling.
>
> so the patch would like
>
> 1. instead of the possibly endless waitpid code
> ---------------------------------------
> add_work(child pipe expiry handler)
> tgt_event_add(child pipe fd, child pipe read handler)
>
>
> 2. child pipe expiry handler
> ------------------------
> terminate child pid
> tgt_event_del(child pipe fd)
> return err on login request
>
> 3. child pipe read handler
> -----------------------
> del_work()
> waitpid on child pid
> read from pipe etc
> return redirect info to login request
Sounds good.
> I guess we're fine from possible locking issues between del_work to
> tgt_event_del as tgt is single threaded?
Yeah. We need to think about it for the multi-thread design in the
near future.
--
To unsubscribe from this list: send the line "unsubscribe stgt" in
the body of a message to majordomo at vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
More information about the stgt
mailing list