andreypopp/domain-context — pull request #3 by jfaissolle (2014-04-07 09:43:04+00:00)
Title: Fix race conditions on variable domain

Hello,

there is a race condition when multiple requests hit the server. The domain context of a request sometimes gets cleaned up at the end of a concurrent request.

The cause is that the domain variable used in the run() function shadows the global variable being used for require('domain') at the start of the file.

I have renamed all domain variables to currentDomain and replaced all the scattered require('domain') by domain which now correctly references the domain library.

Regards