taoensso / carmine

Redis client + message queue for Clojure
https://www.taoensso.com/carmine
Eclipse Public License 1.0
1.16k stars 132 forks source link

NPE on car/with-new-pubsub-listener #68

Closed sritchie closed 10 years ago

sritchie commented 10 years ago

Hey,

Little bug in my upgrade from 2.3.1. When I try to run the following code with an empty spec map (ie, local redis), all's well:

(car/with-new-pubsub-listener (:spec conf)
              {"results" (fn [[message-type topic-name msg]]
                           (broadcast! msg))}
              (car/subscribe "results"))

However, when conf is {:uri "redistogo-url"}, this exception shows up:

java.lang.NullPointerException
    at clojure.core$deref_future.invoke(core.clj:2108)
    at clojure.core$deref.invoke(core.clj:2129)
    at taoensso.carmine.protocol$get_parsed_replies.invoke(protocol.clj:203)
    at taoensso.carmine.connections$make_new_connection$fn__25792.invoke(connections.clj:55)
    at taoensso.carmine.connections$make_new_connection.invoke(connections.clj:56)
    at paddleguru.websocket.PubSub.start_BANG_(form-init1409143132977261857.clj:5)
    at paddleguru.lifecycle$start_system$fn__10186.invoke(lifecycle.clj:15)
    at clojure.lang.ArrayChunk.reduce(ArrayChunk.java:63)

any ideas?

ptaoussanis commented 10 years ago

Hey Sam, thanks a lot for reporting this. Refactored some low-level connection stuff in 2.4 which is almost certainly the culprit. Will try take a look w/in the next 2 hours and get back to you.

Cheers! :-)

ptaoussanis commented 10 years ago

Okay, dug into this. Turns out the 2.4 refactor was uncovering a subtle Pub/Sub connection bug that's been around since before v1.

Just pushed v2.4.3 - I believe that should sort out the problem but please confirm when you can?

Cheers!

sritchie commented 10 years ago

Looks like it works. Thanks for the patch!

ptaoussanis commented 10 years ago

Okay, great - thanks for following up.