freeipmi-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Freeipmi-devel] ipmiconsole_engine_teardown does not seem to block


From: Al Chu
Subject: Re: [Freeipmi-devel] ipmiconsole_engine_teardown does not seem to block as advertised
Date: Thu, 28 Jun 2007 09:19:23 -0700

Hey Levi,

I looked at the code some more to remind myself what it does.  (It's
been over a year :-)

Ignore my last e-mail, lets start over ...

> The comment in ipmiconsole.h for ipmiconsole_engine_teardown() says
that
> > the function will block until all active contexts are closed, but
> > instead it seems to return immediately.  After perusing the code, it
> > does seem to trigger the closing of active connections and the death of
> > the engine threads, but it does not appear to clean up the context
> > objects themselves.  

I really view the engine and the contexts as two separate "objects" the
user is responsible for.  The user "creates" each context and thus is
responsible for "destroying" each one.  The user "inits" the engine and
responsible for "destroying" it as well. (Perhaps the function names
aren't clear?  Should be "init" and "cleanup"??  "bringup" and
"teardown"??)

But I can see how you (and others) might have been confused, thinking
after you "submit" a context to the engine, the engine is responsible
for destroying it.  Was this the confusion?

I should definitely make this more clear if it was confusing.

> > This is fine--I can call ipmi_ctx_destroy() on them afterwards--but if I
> > call ipmiconsole_engine_teardown() I have no way of knowing when the
> > contexts have all closed their sessions so that I know it's safe to
> > start cleaning them all up so I don't get failures due to active
> > sessions.

If you are witnessing that IPMI sessions are not closed after after
ipmiconsole_engine_teardown()?  Or just that the ipmi contexts are not
destroyed?  The later is ok, the former is not ok.  Looking at the code
again, the logic I put in there indicates that the engine_teardown
should not return until each ipmi session closes or times out.  

I now see how the comment:

"* Note that the teardown will block until it all active
 * contexts are closed."

would have been confusing.  Perhaps it should state

"block until all active ipmi sessions are closed or timed out".  

That might make it more clear?

Al

> > 
> > It would be nice to either have the blocking behavior advertised in
> > ipmiconsole.h in ipmiconsole_engine_teardown() itself or an explicitly
> > blocking version of it.



On Thu, 2007-06-28 at 08:42 -0700, Al Chu wrote:
> Hey Levi,
> 
> Thanks for noticing this.  I'm guessing that the implementation changed
> awhile back and I forgot to change the comments.
> 
> I need to look at the code again the refresh my memory on how best to
> implement this.  Looking at ipmiconsole (the tool, not the lib) it seems
> neither ipmiconsole_ctx_destroy() or ipmiconsole_engine_teardown()
> block.  I actually spin waiting for ipmiconsole_ctx_destroy() to return
> a non-zero value back to me.
> 
> I'll modify the comments for now, and add blocking equivalents into my
> TODO. 
> 
> Is this something that's needed soon on your end?
> 
> Al
> 
> On Wed, 2007-06-27 at 18:22 -0600, Levi Pearson wrote:
> > The comment in ipmiconsole.h for ipmiconsole_engine_teardown() says that
> > the function will block until all active contexts are closed, but
> > instead it seems to return immediately.  After perusing the code, it
> > does seem to trigger the closing of active connections and the death of
> > the engine threads, but it does not appear to clean up the context
> > objects themselves.  
> > 
> > This is fine--I can call ipmi_ctx_destroy() on them afterwards--but if I
> > call ipmiconsole_engine_teardown() I have no way of knowing when the
> > contexts have all closed their sessions so that I know it's safe to
> > start cleaning them all up so I don't get failures due to active
> > sessions.
> > 
> > It would be nice to either have the blocking behavior advertised in
> > ipmiconsole.h in ipmiconsole_engine_teardown() itself or an explicitly
> > blocking version of it.
> > 
> >             --Levi
> > 
> > 
> > 
> > _______________________________________________
> > Freeipmi-devel mailing list
> > address@hidden
> > http://lists.gnu.org/mailman/listinfo/freeipmi-devel
> > 
-- 
Albert Chu
address@hidden
925-422-5311
Computer Scientist
High Performance Systems Division
Lawrence Livermore National Laboratory




reply via email to

[Prev in Thread] Current Thread [Next in Thread]