Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Infinite read loop when server disconnects in PubSub mode #31

Closed
mrunonen opened this Issue · 6 comments

2 participants

@mrunonen

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?

@melo
Owner

It's not a known behaviour.

Can you provide:

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

I'll try to reproduce it.

@mrunonen

Hi melo,

Thanks, very swift :)

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

@melo
Owner

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@simplicidade.org>
654beeb
@melo melo closed this issue from a commit
@melo melo Check errno more thoroughly, better detection of EOF situations in __…
…try...

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@simplicidade.org>
ecec0fc
@melo melo closed this in ecec0fc
@melo
Owner

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.

@mrunonen

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

@melo
Owner

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
379b6f2
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.