{"action":"opened","issue":{"url":"https://api.github.com/repos/rethinkdb/rethinkdb/issues/5660","repository_url":"https://api.github.com/repos/rethinkdb/rethinkdb","labels_url":"https://api.github.com/repos/rethinkdb/rethinkdb/issues/5660/labels{/name}","comments_url":"https://api.github.com/repos/rethinkdb/rethinkdb/issues/5660/comments","events_url":"https://api.github.com/repos/rethinkdb/rethinkdb/issues/5660/events","html_url":"https://github.com/rethinkdb/rethinkdb/issues/5660","id":148141387,"number":5660,"title":"Java Driver: Connection is lost during changes(), never times out.","user":{"login":"mschurr","id":3498024,"avatar_url":"https://avatars.githubusercontent.com/u/3498024?v=3","gravatar_id":"","url":"https://api.github.com/users/mschurr","html_url":"https://github.com/mschurr","followers_url":"https://api.github.com/users/mschurr/followers","following_url":"https://api.github.com/users/mschurr/following{/other_user}","gists_url":"https://api.github.com/users/mschurr/gists{/gist_id}","starred_url":"https://api.github.com/users/mschurr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mschurr/subscriptions","organizations_url":"https://api.github.com/users/mschurr/orgs","repos_url":"https://api.github.com/users/mschurr/repos","events_url":"https://api.github.com/users/mschurr/events{/privacy}","received_events_url":"https://api.github.com/users/mschurr/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2016-04-13T18:17:27Z","updated_at":"2016-04-13T18:17:27Z","closed_at":null,"body":"My code is essentially:\r\n\r\n```java\r\ntry (Connection conn = dbp.getConnection()) {\r\n  Cursor<HashMap<String, ?>> cursor = r.table(\"messages\").changes().run(conn);\r\n  for (HashMap<String, ?> item : cursor) {\r\n    .. do stuff ...\r\n  }\r\n}\r\n```\r\n\r\nI connected to the server and was successfully listening to changes. Then, I killed the database server (only a single instance was running). As far as I can tell, the Java driver does not break the for loop when the connection is lost it just keeps sitting there expecting more data forever. There doesn't appear to be any timeout period. And, obviously, if I restart the database server then changes don't start coming in again on that old cursor.\r\n\r\nSo my question is: how are we supposed to detect connection losses and recover from them if the driver just sits there in the loop?\r\n\r\n\r\n\r\n"}}