Skip to content

Message handlers fail after client error #251

@paulgrav

Description

@paulgrav

Summary

I’m currently evaluating Redis+Socket.io and I’m coming across a situation where my
message event handlers stop firing events. I was seeing this after leaving my node.js server
running for a few hours, but now I can always reproduce by publishing a malformatted
message to my Redis server. My work around is to restart my server which is far from
ideal.

Steps to Reproduce

  1. Download this code: https://gist.github.com/3293884
  2. Setup a local Redis instance.
  3. Run the downloaded code in node.js
  4. Send “publish football.match.event foo” to the redis instance.
  5. Send “publish football.match.event "{"foo":"bar"}"” to the redis instance.
  6. Send “publish football.match.event foo” to the redis instance.

Expected Results

The client error handler (line #9) should fire 3 times so I should see this error
repeated 3 times in my logs.

error event - localhost:6379 - SyntaxError: Unexpected token o

Actual Results

I see the above mentioned error message only once. doMessageListen() is never called again.

Notes:

I have redis.debug_mode set to true. When I publish the messages I can see them in my
redis debugging. The following output appears twice in my logs.

net read localhost:6379 id 1: *3
$7
message
$20
football.match.event
$3
foo

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions