These are chat archives for atomix/atomix

16th
May 2016
Kevin Daly
@kedaly
May 16 2016 16:48
Hi I'm writing a program that is using an Atomix client.. It works fine at Runtime, but in debug mode I get io.atomix.copycat.session.ClosedSessionException: session closed
Any Ideas?
Jordan Halterman
@kuujo
May 16 2016 16:49
interesting... Can you paste the client's logs? Preferably with DEBUG level?
Kevin Daly
@kedaly
May 16 2016 16:58
@kuujo I think I'm making the mistake with the way I'm getting the Atomix client.. I get it once in a Spring Bean and then access it.. Do I need to get a new instance of the client every time I need to use it?
@kuujo via Dependency Injection
Jordan Halterman
@kuujo
May 16 2016 17:12
Really, in theory each process should only have one client over its lifetime. There's overhead to a client, and it's not cheap to start or stop clients (gracefully) so no there should just be one instance. The DEBUG logs should show the cause of the session being closed. Basically, when you enable DEBUG logging, you should see the client periodically sending KeepAliveRequest and getting OK KeepAliveResponses from the cluster. What you'll probably see in those logs is at some point the cluster returned an ERROR response saying the client's session is expired. Atomix cients are by default configured to create a new session when their session is expired, but pending commands will be failed with the ClosedSessionException to force users to resubmit those commands (an expired session means linearixability guarantees are lost, so we want users to have to handle that loss of consistency). Still, the session shouldn't be getting expired/closed in the first place. Client and leader debug logs likely show why that happened
Ugh phone spelling :-P
Jonathan Halterman
@jhalterman
May 16 2016 17:28
@kuujo another bit for the docs - that client instances should be reused across requests
the only scenario i can think of where you wouldn't have a client be a complete singleton is if you were actually connecting to different clusters. unless there were some performance benefit to having multiple clients...
Kevin Daly
@kedaly
May 16 2016 18:17
@jhalterman @kuujo Ok by end of next week I have a recipe for spinning up an Atomix Cluster and Clients using dns discovery (prefixes) and as well I should have an Apache Ignite Cluster module written..
Which I will definitely contribute
Jordan Halterman
@kuujo
May 16 2016 18:57
Awesome!
Jonathan Halterman
@jhalterman
May 16 2016 19:22
super awesome
Kevin Daly
@kedaly
May 16 2016 23:45
Ok I am definitely seeing the AtomixClient timing out when running in debug mode, could it be that it's not able to do keepAlives when the JVM threads are frozen at a breakpoint?
So the situation is that I'm running an Atomix Replica and an Atomix Client on the same physical machine but different JVM's.
Kevin Daly
@kedaly
May 16 2016 23:55
I think I found the problem, it's the raft.sessionTimeout on the Atomix Server.