These are chat archives for atomix/atomix

4th
Jul 2016
Mikhail
@middlesphere
Jul 04 2016 08:07
Hi there! I'm a newbie in atomix and have couple of questions. 1) I need to store web sessions, so does the atomix suitable to this task ( I need distributed cache where every node of auth service has a copy of cached web sessions). 2) how to enable authentication to avoid undesired connections? 3) is there any example of SSL establishing?
niquola
@niquola
Jul 04 2016 09:37
Hi @kuujo , another problem :) When i read distributed map in http handler (concurrently) - i've got java.net.ConnectException: failed to connect and client dies forever - looks like race condition in client.
Jordan Halterman
@kuujo
Jul 04 2016 09:38
interesting
niquola
@niquola
Jul 04 2016 09:38
server works, but all queries do not
Jordan Halterman
@kuujo
Jul 04 2016 09:39
that is surprising
all calls are always done on the same thread in the client via an Executor
niquola
@niquola
Jul 04 2016 09:40
i am doing query in http handler - so i think it uses own thread pool
Jordan Halterman
@kuujo
Jul 04 2016 09:40
but that should be fine...
niquola
@niquola
Jul 04 2016 09:40
when i do 2-3 interleaved http requests - i've got java.net.ConnectException: failed to conne
and then it dies forever
Jordan Halterman
@kuujo
Jul 04 2016 09:41
Clients have an I/O thread and an event thread. Regardless of what thread a method is called on, the request is always sent on the I/O thread and events always received on the event thread. Copycat will handle switching threads regardless
hmmm
niquola
@niquola
Jul 04 2016 09:42
May be problem that i run all replicas on one JVM?
shouldn’t be a problem
will have to devise a test I suppose
niquola
@niquola
Jul 04 2016 09:45
Another tip that it does not fail if we have 2 replicas in cluster, but could fail almost instantly if there is 3 replica in cluster
Jordan Halterman
@kuujo
Jul 04 2016 09:48
@middlesphere @electrical implemented SSL support in Catalyst a while back. This test should still be relevant even though it’s disabled.
Whether storing web sessions is a suitable use case probably depends on your throughput and consistency requirements. Everything depends on those two questions. Atomix can’t guarantee that every node has a copy of cached web sessions, and nothing can really guarantee that. What it can guarantee is that once something is written to the cluster a majority of nodes have it. But quorums come at a loss of availability that you have to consider.
really
that’s some odd stuff
niquola
@niquola
Jul 04 2016 09:49
I will try to reproduce it outside http stack.
Jordan Halterman
@kuujo
Jul 04 2016 09:49
that would be awesome
I’ll have to think about this
Richard Pijnenburg
@electrical
Jul 04 2016 09:50
did i break something ? :-)
Jordan Halterman
@kuujo
Jul 04 2016 09:50
no you created something!
that probably works :-)
Richard Pijnenburg
@electrical
Jul 04 2016 09:51
the ssl stuff works perfectly :-)
i don’t make crappy stuff lol
Jordan Halterman
@kuujo
Jul 04 2016 09:51
:shipit:
gotta go take a nap
Richard Pijnenburg
@electrical
Jul 04 2016 09:52
catch you later bud
Jordan Halterman
@kuujo
Jul 04 2016 09:52
it’s 3am in California
Richard Pijnenburg
@electrical
Jul 04 2016 09:52
pff. you better get some sleep then yeah. addicted :p
Jordan Halterman
@kuujo
Jul 04 2016 09:52
indeed
Jordan Halterman
@kuujo
Jul 04 2016 09:58
FYI here’s the failed to connect exception: https://github.com/atomix/copycat/blob/master/client/src/main/java/io/atomix/copycat/client/util/ClientConnection.java#L126
Essentially, what ClientConnection does when sending a message to the cluster is it attempts to send it to the current connection. If that attempt fails, it tries to establish a connection with the next server, and the next server until it runs out of servers and then says it failed to connect. Lots of recursive asynchronous code in there but that be what it do!
off to bed
niquola
@niquola
Jul 04 2016 09:58
ok, thx
good night
niquola
@niquola
Jul 04 2016 10:53

This problem was related to how i get dmap value

(reduce (fn [acc k]
  (assoc acc (keyword k) (decode (.join (.get m k)))))
  {} (.join (.keySet m)))))

so i've changed to

(into {}
        (for [x (.join (.entrySet m))]
          [(.getKey x) (decode (.getValue x))])

and now got -

1. Caused by io.atomix.copycat.error.UnknownSessionException                                                                           
   unknown member session                                                                                                              

         CopycatError.java:  133  io.atomix.copycat.error.CopycatError$Type$6/createException                                          
ClientSessionSubmitter.java:  340  io.atomix.copycat.client.session.ClientSessionSubmitter$QueryAttempt/accept
niquola
@niquola
Jul 04 2016 11:11
ups, i've updated to rc9 - looks like bug dissapear
niquola
@niquola
Jul 04 2016 22:54
Hi, rc9 works smoothly! Could i subscribe to distributed datatypes changes?