ConfigurationExeption and durability

Hi, When I run the code below and shutdown couch base in the middle and then start it again,
I get one ConfigurationException and many CancellationExceptions.
It seems when I get ConfigurationExeption the object has been persisted but not for CancellationException.
That's why I catch ConfigurationExeption and do nothing.
Is there a reason for this?

(defn make-cb-client
([uris bucket]
(CouchbaseClient. (map #(URI. %) uris) bucket ""))
([host port bucket]
(make-cb-client [(format "http://%s:%s/pools" host port)] bucket)))

(def cb-client (make-cb-client "localhost" 8091 "aggregation"))
(def missed (atom {}))
(defn perform-cb! []
(.get (.flush cb-client))
(dotimes [i 200]
(try
#_(Thread/sleep 2000)
(.get (.set cb-client (str i) (JSONValue/toJSONString {"a" 1}) (PersistTo/MASTER)))
(catch ConfigurationException e
)
(catch Throwable e
(swap! missed assoc i e))
))
(println "done!"))

0 Answers

No answers yet