{"action":"created","issue":{"url":"https://api.github.com/repos/apa512/clj-rethinkdb/issues/118","repository_url":"https://api.github.com/repos/apa512/clj-rethinkdb","labels_url":"https://api.github.com/repos/apa512/clj-rethinkdb/issues/118/labels{/name}","comments_url":"https://api.github.com/repos/apa512/clj-rethinkdb/issues/118/comments","events_url":"https://api.github.com/repos/apa512/clj-rethinkdb/issues/118/events","html_url":"https://github.com/apa512/clj-rethinkdb/issues/118","id":118164473,"number":118,"title":"changes feeds dropping results (funky behavior)","user":{"login":"bhurlow","id":1356376,"avatar_url":"https://avatars.githubusercontent.com/u/1356376?v=3","gravatar_id":"","url":"https://api.github.com/users/bhurlow","html_url":"https://github.com/bhurlow","followers_url":"https://api.github.com/users/bhurlow/followers","following_url":"https://api.github.com/users/bhurlow/following{/other_user}","gists_url":"https://api.github.com/users/bhurlow/gists{/gist_id}","starred_url":"https://api.github.com/users/bhurlow/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bhurlow/subscriptions","organizations_url":"https://api.github.com/users/bhurlow/orgs","repos_url":"https://api.github.com/users/bhurlow/repos","events_url":"https://api.github.com/users/bhurlow/events{/privacy}","received_events_url":"https://api.github.com/users/bhurlow/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/apa512/clj-rethinkdb/labels/bug","name":"bug","color":"fc2929"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":10,"created_at":"2015-11-21T02:58:18Z","updated_at":"2016-03-02T00:12:29Z","closed_at":"2016-03-02T00:12:29Z","body":"I've been running into some confusing behavior when trying to use changes feeds. It seems that when I make inserts too close together (< 250ms apart) not all of them come out the other end in the changes stream.\r\n\r\nHere's a lein script to demonstrate,\r\nYou can try it out using [lein-exec](https://github.com/kumarshantanu/lein-exec)\r\nI've tried this on rethinkdb `v2.2.1`\r\n```clj\r\n(use '[leiningen.exec :only  (deps)])\r\n\r\n(deps '[[com.apa512/rethinkdb  \"0.11.0\"]\r\n        [org.clojure/core.async  \"0.2.374\"]])\r\n\r\n(require '[rethinkdb.query :as r] :reload)\r\n(require '[clojure.core.async :refer  (<! >! go go-loop thread take! <!! >!! chan close!)])\r\n\r\n(def conn (r/connect :host \"rethink\"))\r\n\r\n(defn test-insert [x]\r\n  (-> (r/db \"test\")\r\n      (r/table \"test\")\r\n      (r/insert {:myinsert x})\r\n      (r/run conn)))\r\n\r\n;; this makes a cursor\r\n(defn watch-table []\r\n  (-> (r/db \"test\")\r\n      (r/table \"test\")\r\n      (r/changes)\r\n      (r/run conn)))\r\n\r\n;; pump cursor activity into channel inside thread\r\n(defn feed-chan [cursor]\r\n  (let [out (chan)]\r\n    (thread\r\n     (while true\r\n      (>!! out (first cursor))))\r\n    out))\r\n\r\n;; keep track of what we get back \r\n(def change-feed-responses (atom 0))\r\n\r\n;; handle feed results with f \r\n(defn attach-hander-thread [feed f]\r\n  (thread\r\n    (while true\r\n      (println \"received\" (:myinsert (:new_val (<!! feed))))\r\n      (swap! change-feed-responses inc))))\r\n\r\n(def mycursor (watch-table))\r\n(def myfeed (feed-chan mycursor))\r\n\r\n(attach-hander-thread myfeed\r\n  (fn [x] (println \"received:\" (:myinsert x))))\r\n\r\n(def inserts-made (atom 0))\r\n\r\n(doseq [x (range 10)]\r\n  (test-insert x)\r\n  (swap! inserts-made inc))\r\n\r\n(println \"awating all results .... \")\r\n(Thread/sleep 2500)\r\n(println \"made:\" @inserts-made \"and received\" @change-feed-responses \"responses\")\r\n```\r\n\r\nHas anyone else found issues like this or had problems with changes feeds? "},"comment":{"url":"https://api.github.com/repos/apa512/clj-rethinkdb/issues/comments/190983448","html_url":"https://github.com/apa512/clj-rethinkdb/issues/118#issuecomment-190983448","issue_url":"https://api.github.com/repos/apa512/clj-rethinkdb/issues/118","id":190983448,"user":{"login":"apa512","id":319058,"avatar_url":"https://avatars.githubusercontent.com/u/319058?v=3","gravatar_id":"","url":"https://api.github.com/users/apa512","html_url":"https://github.com/apa512","followers_url":"https://api.github.com/users/apa512/followers","following_url":"https://api.github.com/users/apa512/following{/other_user}","gists_url":"https://api.github.com/users/apa512/gists{/gist_id}","starred_url":"https://api.github.com/users/apa512/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apa512/subscriptions","organizations_url":"https://api.github.com/users/apa512/orgs","repos_url":"https://api.github.com/users/apa512/repos","events_url":"https://api.github.com/users/apa512/events{/privacy}","received_events_url":"https://api.github.com/users/apa512/received_events","type":"User","site_admin":false},"created_at":"2016-03-02T00:12:29Z","updated_at":"2016-03-02T00:12:29Z","body":"Should work now using the latest release. Let's reopen otherwise."}}