apa512 / clj-rethinkdb

Eclipse Public License 1.0
205 stars 42 forks source link

Detecting connection closed when pulling changes #164

Open vlobanov opened 8 years ago

vlobanov commented 8 years ago

Hello,

I'm trying to use changes query, and problem is that if I start pulling, e.g.

(-> (r/db "test")
    (r/table "messages")
    r/changes
    (r/run conn)
    first)

And then shut down DB server, I never get an exception. It just hangs forever. Java driver had the same issue, but as far as I can see their solution (re-throw all exceptions) is not applicable in the case.

I didn't see any ping messages protocol, so maybe it's hard or impossible to detect network issues, but when RethinkDB is just shut down and closes connection, that should be possible to detect, right?

I could check periodically if connection is still open as a workaround, but maybe there is a better way?

apa512 commented 8 years ago

Netty is making me extremely confused but it's probably fixable somehow.