Bird
0
0

Why is it important for the master process in a Node.js cluster to handle worker 'exit' events properly?

hard📝 Conceptual Q10 of 15
Node.js - Cluster Module
Why is it important for the master process in a Node.js cluster to handle worker 'exit' events properly?
ATo allow workers to share memory efficiently
BTo ensure the application remains available by replacing crashed workers
CTo prevent the master process from consuming too much CPU
DTo enable workers to communicate directly with each other
Step-by-Step Solution
Solution:
  1. Step 1: Understand master responsibility

    The master must keep the app running by replacing workers that crash.
  2. Step 2: Other options describe unrelated concepts

    Memory sharing, CPU usage, and worker communication are not handled by exit events.
  3. Final Answer:

    Master handles exit events to replace crashed workers and keep app available -> Option B
  4. Quick Check:

    Master replaces crashed workers to maintain availability [OK]
Quick Trick: Master replaces crashed workers to keep app running [OK]
Common Mistakes:
  • Confusing exit handling with memory sharing
  • Thinking exit events control CPU usage
  • Assuming exit events enable worker communication

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Node.js Quizzes