LearnBoost / up

Zero-downtime reloads and requests load balancer based on distribute.
540 stars 73 forks source link

UpServer tries to reload twice in a row and fails #52

Open accerqueira opened 11 years ago

accerqueira commented 11 years ago

The command line I use was: node node_modules/up/bin/up -p 9400 -w server

After I touched a file, the following happens:

  up-cli /home/accerqueira/experiments/server/server.js change detected - reloading
  up reloading - spawning 2 new workers
  up spawning 2 workers from master 8738
  up worker 8745 created
  up worker 8746 created
  up-cli /home/accerqueira/experiments/server/server.js change detected - reloading
  up killing spawning worker 8745

/home/accerqueira/experiments/server/node_modules/up/lib/up.js:127
    this.spawning[i].shutdown();
                     ^
TypeError: Cannot call method 'shutdown' of undefined
    at UpServer.reload (/home/accerqueira/experiments/gg-web/node_modules/up/lib/up.js:127:22)
    at /home/accerqueira/experiments/gg-web/node_modules/up/bin/up:288:9
    at FSWatcher.<anonymous> (/home/accerqueira/experiments/gg-web/node_modules/up/bin/up:275:9)
    at FSWatcher.emit (events.js:70:17)
    at FSEvent.onchange (fs.js:665:12)

I'm using 15e82c6dcd04121794ad84cfa5f7de8169bf3e32, traced the error back to dc4e57eda6b42e9b8896e62dc893d1ac585fecd8, when it was working, but I could fix by reverting 2 lines from 6ad3f6b6fb3b42b7292bf78b997a83812773739b.