LearnBoost / cluster

Node.JS multi-core server manager with plugins support.
http://learnboost.github.com/cluster
MIT License
2.29k stars 159 forks source link

workers.error.log & workers.access.log not being created/written #177

Closed jeffv closed 12 years ago

jeffv commented 12 years ago

It appears that the event bind is failing circa /plugins/logger.js:135

I can confirm that the 'worker' event does indeed happen, and that it is bindable.

It appears that the bind is happening long after the 'worker' event has already been emitted, resulting in the function never being called.

This was tested on node v0.4.7, v0.4.12 and cluster v0.7.6 and v0.7.7. This also can be shown using /examples/logger.js.

jeffv commented 12 years ago

This appears to have been introduced in commit a3fb1eca49462125f2b36ada3bbe15639170d5e7 in v0.7.0

My feeling is that the callback for creating the directory is delaying 'worker' event bind and causing the issue. We have a race condition between the server starting workers and the directory being created.

telendt commented 12 years ago

IMHO it's duplicate of #169.

jeffv commented 12 years ago

Ah yes. It is. You are correct. Going to close this issue in favor of #169.