Skip to content

Commit

Permalink
Worked around node bug in cluster.js, now our UDP audit server will n…
Browse files Browse the repository at this point in the history
…ot be clustered. (See nodejs/node-v0.x-archive#9261)
  • Loading branch information
rcrichton committed Mar 20, 2015
1 parent e7ba9d2 commit 82020fc
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion src/server.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,18 @@ else

auditing.processAudit msg, -> logger.info "[Auditing UDP] Processed audit"

auditUDPServer.bind auditUDPPort, bindAddress
auditUDPServer.on 'error', (err) ->
if err.code is 'EADDRINUSE'
# ignore to allow only 1 worker to bind (workaround for: https://github.com/joyent/node/issues/9261)
defer.resolve()
else
logger.error "UDP Audit server error: #{err}", err
defer.reject err

auditUDPServer.bind
port: auditUDPPort
address: bindAddress
exclusive: true # workaround for: https://github.com/joyent/node/issues/9261

return defer.promise

Expand Down

0 comments on commit 82020fc

Please sign in to comment.