mapbox/tilemill — Issue #1073: `EADDRINUSE` does not cleanly exit
Author: springmeyer
Created: 2012-01-04 18:25:41+00:00
State: open

With latest master if tilemill starts and finds the ports already in use then it leads to an infinite error loop of repeated `EADDRINUSE`.

```

node.js:134
throw e; // process.nextTick error, or 'error' event on first tick
^
Error: EADDRINUSE, Address already in use
at [object Object]._doListen (net.js:1100:5)
at net.js:1071:14
at Object.lookup (dns.js:159:5)
at [object Object].listen (net.js:1065:20)
at [object Object].start (/Users/dane/projects/tilemill/node_modules/bones/server/server.js:34:27)
at [object Object].initialize (/Users/dane/projects/tilemill/commands/tile.bones:24:26)
at [object Object]. (/Users/dane/projects/tilemill/node_modules/bones/server/command.js:8:14)
at native
at [object Object].bootstrap (/Users/dane/projects/tilemill/commands/tile.bones:18:5)
at [object Object].Command (/Users/dane/projects/tilemill/node_modules/bones/server/command.js:7:10)
Plugin [carto] loaded.
Plugin [editor] loaded.
Plugin [fonts] loaded.
Plugin [map] loaded.
Plugin [templates] loaded.

node.js:134
throw e; // process.nextTick error, or 'error' event on first tick
^
Error: EADDRINUSE, Address already in use
at [object Object]._doListen (net.js:1100:5)
at net.js:1071:14
at Object.lookup (dns.js:159:5)
at [object Object].listen (net.js:1065:20)
at [object Object].start (/Users/dane/projects/tilemill/servers/Core.bones:5:23)
at [object Object].initialize (/Users/dane/projects/tilemill/commands/core.bones:175:26)
at [object Object]. (/Users/dane/projects/tilemill/node_modules/bones/server/command.js:8:14)
at native
at [object Object].bootstrap (/Users/dane/projects/tilemill/commands/core.bones:169:5)
at [object Object].Command (/Users/dane/projects/tilemill/node_modules/bones/server/command.js:7:10)

node.js:134
throw e; // process.nextTick error, or 'error' event on first tick
^
Error: EADDRINUSE, Address already in use
at [object Object]._doListen (net.js:1100:5)
at net.js:1071:14
at Object.lookup (dns.js:159:5)
at [object Object].listen (net.js:1065:20)
at [object Object].start (/Users/dane/projects/tilemill/node_modules/bones/server/server.js:34:27)
at [object Object].initialize (/Users/dane/projects/tilemill/commands/tile.bones:24:26)
at [object Object]. (/Users/dane/projects/tilemill/node_modules/bones/server/command.js:8:14)
at native
at [object Object].bootstrap (/Users/dane/projects/tilemill/commands/tile.bones:18:5)
at [object Object].Command (/Users/dane/projects/tilemill/node_modules/bones/server/command.js:7:10)
Plugin [carto] loaded.
Plugin [editor] loaded.
Plugin [fonts] loaded.
Plugin [map] loaded.
Plugin [templates] loaded.

node.js:134
throw e; // process.nextTick error, or 'error' event on first tick
^
Error: EADDRINUSE, Address already in use
at [object Object]._doListen (net.js:1100:5)
at net.js:1071:14
at Object.lookup (dns.js:159:5)
at [object Object].listen (net.js:1065:20)
at [object Object].start (/Users/dane/projects/tilemill/servers/Core.bones:5:23)
at [object Object].initialize (/Users/dane/projects/tilemill/commands/core.bones:175:26)
at [object Object]. (/Users/dane/projects/tilemill/node_modules/bones/server/command.js:8:14)
at native
at [object Object].bootstrap (/Users/dane/projects/tilemill/commands/core.bones:169:5)
at [object Object].Command (/Users/dane/projects/tilemill/node_modules/bones/server/command.js:7:10)

node.js:134
throw e; // process.nextTick error, or 'error' event on first tick
^
Error: EADDRINUSE, Address already in use
at [object Object]._doListen (net.js:1100:5)
at net.js:1071:14
at Object.lookup (dns.js:159:5)
at [object Object].listen (net.js:1065:20)
at [object Object].start (/Users/dane/projects/tilemill/node_modules/bones/server/server.js:34:27)
at [object Object].initialize (/Users/dane/projects/tilemill/commands/tile.bones:24:26)
at [object Object]. (/Users/dane/projects/tilemill/node_modules/bones/server/command.js:8:14)
at native
at [object Object].bootstrap (/Users/dane/projects/tilemill/commands/tile.bones:18:5)
at [object Object].Command (/Users/dane/projects/tilemill/node_modules/bones/server/command.js:7:10)
Plugin [carto] loaded.
Plugin [editor] loaded.
Plugin [fonts] loaded.
Plugin [map] loaded.
Plugin [templates] loaded.

node.js:134
throw e; // process.nextTick error, or 'error' event on first tick
^
Error: EADDRINUSE, Address already in use
at [object Object]._doListen (net.js:1100:5)
at net.js:1071:14
at Object.lookup (dns.js:159:5)
at [object Object].listen (net.js:1065:20)
at [object Object].start (/Users/dane/projects/tilemill/servers/Core.bones:5:23)
at [object Object].initialize (/Users/dane/projects/tilemill/commands/core.bones:175:26)
at [object Object]. (/Users/dane/projects/tilemill/node_modules/bones/server/command.js:8:14)
at native
at [object Object].bootstrap (/Users/dane/projects/tilemill/commands/core.bones:169:5)
at [object Object].Command (/Users/dane/projects/tilemill/node_modules/bones/server/command.js:7:10)
[...snip...]
```