LearnBoost / cluster

Node.JS multi-core server manager with plugins support.
http://learnboost.github.com/cluster
MIT License
2.29k stars 159 forks source link

connection left as 'open' on workers #133

Closed lholden closed 13 years ago

lholden commented 13 years ago

I am having a problem were a worker will report that it has a connection active for quite a while after receiving its first connection. This does not seem to prevent the worker from handling additional requests... but it does make shutdown/restart/reload take forever.

Simple application to test this with (that replicates the issue for me anyhow)

server.coffee

cluster = require 'cluster'

cluster('./app')
  .set('socket path', 'tmp/sockets')
  .set('workers', 1)

  #.use(cluster.reload())
  .use(cluster.logger('logs'))
  .use(cluster.stats({ connections: true, requests: true }))
  .use(cluster.pidfiles('tmp/pids'))
  .use(cluster.cli())
  .use(cluster.repl('tmp/sockets/repl.sock'))
  .use(cluster.debug())
  .listen(3000)

app.coffee

express = require 'express'

app = express.createServer()
app.get '/', (req, res)->
  res.send 'hello world!!'

module.exports = app

stats() from the repl

cluster> stats()

  Master
  os: Linux 2.6.38.8-32.fc15.x86_64
  state: active
  started: Tue, 26 Jul 2011 07:48:05 GMT
  uptime: 2 minutes
  restarts: 0
  workers: 1
  deaths: 0

  Resources
  load average: 0.00 0.03 0.05
  cores utilized: 1 / 4
  memory at boot (free / total): 4.23gb / 7.81gb
  memory now (free / total): 4.23gb / 7.81gb

  Workers
  connections total: 1
  connections active: 1
  requests total: 10
  0: 2 minutes 1|1|10
tj commented 13 years ago

hmm can you quantify "forever"? because node's http sockets timeout after 2 minutes and i believe cluster also has a timeout option, so after that amount of time the child is killed regardless of open connections, which I think I have defaulting to two minutes as well

lholden commented 13 years ago

I mean until "node's http sockets timeout after 2 minutes" :D

tj commented 13 years ago

ah! fewf haha. feel free to tweak that setting if you need to

tj commented 13 years ago

reopened? still an issue or can I close?

lholden commented 13 years ago

Sorry, go ahead :)

On Jul 29, 2011 11:03 AM, "visionmedia" < reply@reply.github.com> wrote:

reopened? still an issue or can I close?

Reply to this email directly or view it on GitHub: https://github.com/LearnBoost/cluster/issues/133#issuecomment-1682867