On Fri, Nov 30, 2012 at 4:25 PM, Forrest L Norvell <[email protected]> wrote:

>  it would be nice if there were a
> convention to shut down and clean all of those resources when things go
> haywire.

Yes, it would be nice.  But:

> Domains take on a lot of the hard work of tracking the handles and EEs put
> into play in a certain context, and

No, they don't track handles and EEs, it's the other way around!
Event emitters have a link to the domain.  The domain only has a link
to Event Emitters and such that are added explicitly with
domain.add(obj).

The problem is that we create quite a lot of tick callbacks and
EventEmitters and handles, and the list of things gets pretty big.
Doing that for every request is just too expensive, for the edge case
where one of them blows up.

It might be worthwhile to loop through the process._getActiveHandles()
and process._getActiveRequests() lists and see if any of them are
referring to the disposed domain, and if so... what?  The same
heuristics that don't inspire confidence now?

Maybe we need some generic way to kill any HandleWrap or ReqWrap, and
a generic destroy() function that everything in Node with a ._handle
member will respond to?

I think maybe we're getting to somewhere useful in this conversation.

-- 
Job Board: http://jobs.nodejs.org/
Posting guidelines: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en

Reply via email to