iriscouch / follow

Very stable, very reliable, NodeJS CouchDB _changes follower
Apache License 2.0
393 stars 82 forks source link

Calling stop() from a change handler leaks a timer #8

Closed jhs closed 12 years ago

jhs commented 12 years ago

The problem:

  1. Data arrives, the data handler runs
  2. A Feed decides a change happened
  3. It fires a "change" event
  4. The handler calls .die()
  5. The die code cleans up stuff
  6. The stack unwinds and we realize we are still in the data handler from step 1
  7. That data handler calls self.wait() which starts a timer, so Node can't exit