- Fix:
node-statsd
dependency added to production dependencies
- New: increment
statsd
on start of master/worker processes
- Small tweak to
Graceful._finalLog
- instead of relying onwinston
callback or asetTimeout(fn, 250)
to ensure that the final log entry hits the disk, we just do asetTimeout(fn, 0)
to give it a chance. And the tests no longer check for that last entry, because it's not reliable. May introduce a feature in the future where the process is allowed to die naturally, since we've already stopped the server, etc. This would require that we and the overall client programunref()
all timers. - Small tweak to
Master._restartWorker
- it seems that sometimes we would get adisconnect
event before the worker had been removed fromcluster.workers
so we sometimes didn't log this very important error 'No workers currently running!' Now we check our own list atthis._workers
. - Overhaul of tests due to this breaking change in node 0.12/iojs. Tests were previously assuming that a request immediately after worker crash would hit the next worker; now the connection is refused until the new worker is up.
- Travis now runs on node 0.12 and iojs 1.4/1.5/1.6 only. Didn't feel like making the tests work on 0.10 as well as the new systems.
- Update dev dependencies
DomainMiddleware
class renamed toGracefulExpress
- All public APIs throw on incorrect parameters
Graceful
is resilient to errors thrown by provided 'check' functions or registered 'shutdown' event handlers- New mode in
GracefulExpress
:inProcessTest
. Iftrue
, will not set up a domain for each request, allowing for easier in-process testing withsupertest
. GracefulExpress
: tightens up graceful shutdown by:- Closing keepalive connections for all in-progress requests and idle sockets
- Starting a socket reaper to continually look for and close idle sockets
- Installing a backstop in case issues get through, return
Error
withstatusCode = 503
- Logging: reduce verbosity, move to
thehelp-log-shim
to leave logging decisions to the process - Upgrade to
1.x
series ofthehelp-last-ditch
, which doesn't send SMS by default any longer - Substantial test coverage added
- Remove peer dependencies in favor of real dependencies
- Remove dependency on
lodash
- Update to the more bulletproofed 0.3.x-series of
thehelp-last-ditch
- Update dev dependencies
DomainMiddleware
no longer warns on 'unfinished' responses; seems that this event isn't fully reliable in the face of all server topologies. We bind to 'finish', 'close' and 'end' events on theresponse
object, but the handler is wrapped with_.once()
.
Startup
now allows configuration of logs directory - viaoptions.logs
on construction or the LOGS environment variable. Defaults to './logs/'
- Pare down what's in the npm package
Breaking:
GracefulWorker
was renamed toGraceful
, and now allows others to register for shutdown notification, doesn't callserver.close()
directly, and no longer acts as middleware.Domain-Middleware
now needs aserver
reference, callsserver.close()
, registers forGraceful
shutdown notification, then sends 'connection:close' for all subsequent requests itselfMaster
no longer handles shutdown itself, instead delegating toGraceful
- if creating manually, be sure to supply aGraceful
instanceStartup
now only callsmessenger
if noGraceful
instance can be found
Other updates:
- Update dev dependencies
Master.stop()
now takes a callbackDomainMiddlware
now logs a warning instead of an error when it gets ares.on('close')
event- Dev dependency upgrade: supertest
- Easy startup of cluster application with root
startup
method - Fully functional
Master
,Startup
,GracefulWorker
andDomainMiddleware
classes - Graceful shutdown of both master and worker processes with proper exit codes, both for top-level and request-specific errors