{"action":"created","issue":{"url":"https://api.github.com/repos/rethinkdb/rethinkdb/issues/5439","repository_url":"https://api.github.com/repos/rethinkdb/rethinkdb","labels_url":"https://api.github.com/repos/rethinkdb/rethinkdb/issues/5439/labels{/name}","comments_url":"https://api.github.com/repos/rethinkdb/rethinkdb/issues/5439/comments","events_url":"https://api.github.com/repos/rethinkdb/rethinkdb/issues/5439/events","html_url":"https://github.com/rethinkdb/rethinkdb/issues/5439","id":135774531,"number":5439,"title":"Java changefeed API does not recover after a database restart","user":{"login":"gyim","id":76000,"avatar_url":"https://avatars.githubusercontent.com/u/76000?v=3","gravatar_id":"","url":"https://api.github.com/users/gyim","html_url":"https://github.com/gyim","followers_url":"https://api.github.com/users/gyim/followers","following_url":"https://api.github.com/users/gyim/following{/other_user}","gists_url":"https://api.github.com/users/gyim/gists{/gist_id}","starred_url":"https://api.github.com/users/gyim/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gyim/subscriptions","organizations_url":"https://api.github.com/users/gyim/orgs","repos_url":"https://api.github.com/users/gyim/repos","events_url":"https://api.github.com/users/gyim/events{/privacy}","received_events_url":"https://api.github.com/users/gyim/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/rethinkdb/rethinkdb/labels/Java","name":"Java","color":"fef2c0"},{"url":"https://api.github.com/repos/rethinkdb/rethinkdb/labels/tp:bug","name":"tp:bug","color":"e102d8"}],"state":"open","locked":false,"assignee":{"login":"deontologician","id":1366,"avatar_url":"https://avatars.githubusercontent.com/u/1366?v=3","gravatar_id":"","url":"https://api.github.com/users/deontologician","html_url":"https://github.com/deontologician","followers_url":"https://api.github.com/users/deontologician/followers","following_url":"https://api.github.com/users/deontologician/following{/other_user}","gists_url":"https://api.github.com/users/deontologician/gists{/gist_id}","starred_url":"https://api.github.com/users/deontologician/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/deontologician/subscriptions","organizations_url":"https://api.github.com/users/deontologician/orgs","repos_url":"https://api.github.com/users/deontologician/repos","events_url":"https://api.github.com/users/deontologician/events{/privacy}","received_events_url":"https://api.github.com/users/deontologician/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/rethinkdb/rethinkdb/milestones/104","html_url":"https://github.com/rethinkdb/rethinkdb/milestones/2.2.x","labels_url":"https://api.github.com/repos/rethinkdb/rethinkdb/milestones/104/labels","id":1249551,"number":104,"title":"2.2.x","description":"","creator":{"login":"danielmewes","id":505365,"avatar_url":"https://avatars.githubusercontent.com/u/505365?v=3","gravatar_id":"","url":"https://api.github.com/users/danielmewes","html_url":"https://github.com/danielmewes","followers_url":"https://api.github.com/users/danielmewes/followers","following_url":"https://api.github.com/users/danielmewes/following{/other_user}","gists_url":"https://api.github.com/users/danielmewes/gists{/gist_id}","starred_url":"https://api.github.com/users/danielmewes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/danielmewes/subscriptions","organizations_url":"https://api.github.com/users/danielmewes/orgs","repos_url":"https://api.github.com/users/danielmewes/repos","events_url":"https://api.github.com/users/danielmewes/events{/privacy}","received_events_url":"https://api.github.com/users/danielmewes/received_events","type":"User","site_admin":false},"open_issues":32,"closed_issues":3,"state":"open","created_at":"2015-08-11T07:18:11Z","updated_at":"2016-02-25T00:40:41Z","due_on":null,"closed_at":null},"comments":6,"created_at":"2016-02-23T15:45:34Z","updated_at":"2016-02-25T12:06:10Z","closed_at":null,"body":"I set up a changefeed for a table and restarted RethinkDB. After restarting the database the application did not receive any notifications about the changes, and no exceptions were thrown.\r\n\r\nHow to reproduce the issue:\r\n\r\n- Start the latest official RethinkDB docker image (2.2.4, image ID `eeff71def8c6`)\r\n- Create the table `test_table` in database `test`\r\n- Start the code below\r\n- Make any changes in the `test_table` table => the code logs the changes\r\n- Run `docker stop rethinkdb; sleep 1; docker start rethinkdb`\r\n- Make any changes in the table => the code does not log anything, but the app jumps to 100% CPU usage. (I waited a minute to make sure that if the client wants to reconnect, it has enough time for that).\r\n\r\nTest code:\r\n\r\n```java\r\npackage hu.gyim.rethinkdb_test;\r\n\r\nimport com.rethinkdb.RethinkDB;\r\nimport com.rethinkdb.net.Connection;\r\nimport com.rethinkdb.net.Cursor;\r\n\r\npublic class Main {\r\n\r\n    public static void main(String[] args) {\r\n        try {\r\n            Connection conn = RethinkDB.r.connection().hostname(\"192.168.99.100\").port(28015).connect();\r\n            conn.use(\"test\");\r\n\r\n            Cursor cur = RethinkDB.r.table(\"test_table\").changes().run(conn);\r\n            for (Object change : cur) {\r\n                System.out.println(change);\r\n            }\r\n        } catch (Exception e) {\r\n            e.printStackTrace();\r\n        }\r\n    }\r\n}\r\n```\r\n\r\nStack trace after the restart:\r\n\r\n```\r\n\"main@1\" prio=5 tid=0x1 nid=NA runnable\r\n  java.lang.Thread.State: RUNNABLE\r\n      at sun.nio.ch.FileDispatcherImpl.read0(FileDispatcherImpl.java:-1)\r\n      at sun.nio.ch.SocketDispatcher.read(SocketDispatcher.java:39)\r\n      at sun.nio.ch.IOUtil.readIntoNativeBuffer(IOUtil.java:223)\r\n      at sun.nio.ch.IOUtil.read(IOUtil.java:197)\r\n      at sun.nio.ch.SocketChannelImpl.read(SocketChannelImpl.java:380)\r\n      - locked <0x416> (a java.lang.Object)\r\n      at com.rethinkdb.net.SocketWrapper.recvall(SocketWrapper.java:107)\r\n      at com.rethinkdb.net.ConnectionInstance.readResponse(ConnectionInstance.java:70)\r\n      at com.rethinkdb.net.Connection.readResponse(Connection.java:130)\r\n      at com.rethinkdb.net.Cursor$DefaultCursor.getNext(Cursor.java:172)\r\n      at com.rethinkdb.net.Cursor.next(Cursor.java:110)\r\n      at hu.gyim.rethinkdb_test.Main.main(Main.java:15)\r\n```"},"comment":{"url":"https://api.github.com/repos/rethinkdb/rethinkdb/issues/comments/188755405","html_url":"https://github.com/rethinkdb/rethinkdb/issues/5439#issuecomment-188755405","issue_url":"https://api.github.com/repos/rethinkdb/rethinkdb/issues/5439","id":188755405,"user":{"login":"pires","id":1752631,"avatar_url":"https://avatars.githubusercontent.com/u/1752631?v=3","gravatar_id":"","url":"https://api.github.com/users/pires","html_url":"https://github.com/pires","followers_url":"https://api.github.com/users/pires/followers","following_url":"https://api.github.com/users/pires/following{/other_user}","gists_url":"https://api.github.com/users/pires/gists{/gist_id}","starred_url":"https://api.github.com/users/pires/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pires/subscriptions","organizations_url":"https://api.github.com/users/pires/orgs","repos_url":"https://api.github.com/users/pires/repos","events_url":"https://api.github.com/users/pires/events{/privacy}","received_events_url":"https://api.github.com/users/pires/received_events","type":"User","site_admin":false},"created_at":"2016-02-25T12:06:09Z","updated_at":"2016-02-25T12:06:09Z","body":"> at com.rethinkdb.net.ConnectionInstance.readResponse(ConnectionInstance.java:70)\r\n\r\n`ConnectionInstance` is gone in the latest version, `2.2-beta-5`."}}