On Thu, 2007-06-28 at 09:19 -0700, Al Chu wrote: > 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.
No, this isn't confusing at all. I only started wondering if the engine teardown might destroy the contexts as well when I started looking through the code and headers and saw that it was supposedly blocking until the sessions stopped. > > > > 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 was calling ipmiconsole_engine_teardown(), which I was assuming would block until the sessions all closed. At which point I assumed that calling ipmi_ctx_destroy() would succeed. In my most recent test, I call ipmiconsole_engine_teardown() followed by a spinning call to ipmi_ctx_destroy() for each context, but they never do succeed. I'm guessing that instead of just calling ipmiconsole_engine_teardown(), I'm going to have to loop over all the contexts and close their file descriptors, then do the ipmi_ctx_destroy() calls, then do ipmiconsole_engine_teardown(). It would be handy to have a call that does trigger the closing of all sessions such that ipmi_ctx_destroy() will work on them afterward, though. --Levi _______________________________________________ Freeipmi-devel mailing list Freeipmi-devel@gnu.org http://lists.gnu.org/mailman/listinfo/freeipmi-devel