Skip to content


Subversion checkout URL

You can clone with
Download ZIP


Infinite read loop when server disconnects in PubSub mode #31

mrunonen opened this Issue · 6 comments

2 participants


Connected client that is in PubSub mode seems to go into an infinite loop when the server side disconnects. Looking inside the module, it is this

while (__try_read_sock($sock))

in wait_for_messages() that never returns.

Is this known behaviour or a defect?


It's not a known behaviour.

Can you provide:

  • the operating system: we had problems with windows before;
  • which version are you using.

I'll try to reproduce it.


Hi melo,

Thanks, very swift :)

Red Hat Enterprise Linux Server release 5.5 (Tikanga) / 1.958 / perl 5, version 14, subversion 1 (v5.14.1)


Ok, pretty sane environment :)

Probably a bug. I'll check it out.

@melo melo referenced this issue from a commit
@melo melo Add test case for #31: wait_for_messages() shouldn't block if sock is…
… dead

Signed-off-by: Pedro Melo <>
@melo melo closed this issue from a commit
@melo melo Check errno more thoroughly, better detection of EOF situations in __…

A more sistematic approch:

 * check by-the-book error conditions;
 * check the real-world conditions we found over the times;
 * make sure __try_read_sock has sane and consistent return codes:
   * undef => EOF;
   * 0 => socket is alive but would block;
   * 1 => there is stuff to read, do it.

Fixes #31.

Signed-off-by: Pedro Melo <>
@melo melo closed this in ecec0fc

Please test master if you can... It should be fixed. I'm going to wait for Travis build 49 (build 48 only included the failing test case) to see if everything is kosher and then release 1.959.


Just tried master, works perfectly. Thank you very much & keep up the good work!


Cool, glad to know.

Will release 1.959 after lunch, Travis should be done by then...

(@Ovid: this might fix #32, but will not include #33, I need a bit more time to merge #33, master drifted away from you base point; I'll do it tonight).

@melo melo referenced this issue from a commit
@melo melo v1.959
    * __try_read_sock: test error conditions more thoroughly (issue #31)
    * Improve Test::SpawnRedisServer: multi-server support
    * tidyall the code and docs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.