Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Guard against shuffling #6

Closed
viesti opened this Issue Jul 8, 2014 · 1 comment

Comments

Projects
None yet
2 participants

viesti commented Jul 8, 2014

Seems that Couchbase Java library might mutate the list of URI:s (bleargh :P, see https://github.com/couchbase/couchbase-java-client/blob/1.3.2/src/main/java/com/couchbase/client/CouchbaseConnectionFactory.java#L573), so we should guard against this by passing in a mutable list.

Exception in thread "main" java.lang.UnsupportedOperationException, compiling:(/home/xxxx/xxxx/./xxxxx.clj:69:76)
        at clojure.lang.Compiler.load(Compiler.java:7142)
        at clojure.lang.Compiler.loadFile(Compiler.java:7086)
        at clojure.lang.RT$3.invoke(RT.java:318)
        at user$eval5.invoke(form-init848426659431904946.clj:1)
        at clojure.lang.Compiler.eval(Compiler.java:6703)
        at clojure.lang.Compiler.eval(Compiler.java:6693)
        at clojure.lang.Compiler.load(Compiler.java:7130)
        at clojure.lang.Compiler.loadFile(Compiler.java:7086)
        at clojure.main$load_script.invoke(main.clj:274)
        at clojure.main$init_opt.invoke(main.clj:279)
        at clojure.main$initialize.invoke(main.clj:307)
        at clojure.main$null_opt.invoke(main.clj:342)
        at clojure.main$main.doInvoke(main.clj:420)
        at clojure.lang.RestFn.invoke(RestFn.java:421)
        at clojure.lang.Var.invoke(Var.java:383)
        at clojure.lang.AFn.applyToHelper(AFn.java:156)
        at clojure.lang.Var.applyTo(Var.java:700)
        at clojure.main.main(main.java:37)
Caused by: java.lang.UnsupportedOperationException
        at clojure.lang.LazySeq.set(LazySeq.java:197)
        at java.util.Collections.swap(Collections.java:491)
        at java.util.Collections.shuffle(Collections.java:459)
        at java.util.Collections.shuffle(Collections.java:428)
        at com.couchbase.client.CouchbaseConnectionFactory.potentiallyRandomizeNodeList(CouchbaseConnectionFactory.java:573)
        at com.couchbase.client.CouchbaseConnectionFactory.initialize(CouchbaseConnectionFactory.java:207)
        at com.couchbase.client.CouchbaseConnectionFactory.<init>(CouchbaseConnectionFactory.java:203)
        at com.couchbase.client.CouchbaseConnectionFactoryBuilder$1.<init>(CouchbaseConnectionFactoryBuilder.java:242)
        at com.couchbase.client.CouchbaseConnectionFactoryBuilder.buildCouchbaseConnection(CouchbaseConnectionFactoryBuilder.java:242)
        at couchbase_clj.client_builder$create_factory.invoke(client_builder.clj:202)
        at couchbase_clj.client_builder$build.invoke(client_builder.clj:231)
        at couchbase_clj.client$create_client.invoke(client.clj:1369)
        at user$mongo__GT_couchbase.invoke(mongo_to_couchbase.clj:39)
        at user$eval3308.invoke(mongo_to_couchbase.clj:72)
        at clojure.lang.Compiler.eval(Compiler.java:6703)
        at clojure.lang.Compiler.load(Compiler.java:7130)
        ... 17 more
Owner

otabat commented Jul 8, 2014

Oh... thanks for the report. Now working on a fix.

@otabat otabat closed this in 7cf0a50 Jul 8, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment