These are chat archives for atomix/atomix

15th
Mar 2016
Richard Pijnenburg
@electrical
Mar 15 2016 00:05
hmm as soon as i tell a class it implements runnable i can’t do any initialisation :-(
Richard Pijnenburg
@electrical
Mar 15 2016 00:17
its so confusing
Jordan Halterman
@kuujo
Mar 15 2016 00:17
Weird... Are you using a Java IDE?
IntelliJ or Eclipse?
Richard Pijnenburg
@electrical
Mar 15 2016 00:18
vim :p
but i should use something yeah
Jordan Halterman
@kuujo
Mar 15 2016 00:18
One of those will help you a ton
Because it's compiled it can tell you a lot
Makes a huge difference in Java world
One of my co-workers used to do Java in vim. I think you just have to know the language really well for it
Richard Pijnenburg
@electrical
Mar 15 2016 00:19
hehe yeah
installing eclips now
im able to run an example. but also need do an initialization step for a plugin for example and share it across the threads
Jordan Halterman
@kuujo
Mar 15 2016 00:27
you should also look in to the volatile and synchronized keywords for threading
volatile is linearizable variables, and synchronized is locks
locks being built in to the language
Richard Pijnenburg
@electrical
Mar 15 2016 00:51
installed eclips
ah . init part is working now :-)
only if i have a function with the same name as the class
can’t call it init or something ?
Richard Pijnenburg
@electrical
Mar 15 2016 01:29
getting a headache of this stuff :-(
time for some sleep
Joachim De Beule
@joachimdb
Mar 15 2016 10:34
Hey there, trying out the atomix rc3. Groups seem to be broken?
Richard Pijnenburg
@electrical
Mar 15 2016 10:35
I know they’ve been rewriting quite a bit around the groups stuff
but they usually do releases only if the tests pass
Joachim De Beule
@joachimdb
Mar 15 2016 10:36
  (def r (-> (AtomixReplica/builder (Address. "localhost" 8012) [(Address. "localhost" 8012)])
             (.withTransport (NettyTransport.))
             (.withStorage (Storage. StorageLevel/MEMORY))
             (.build)))
  (def o (.get (.open r)))

  (def g (.getGroup r "foo"))
Then g never completes and in the logs I see this:
2016-03-15 11:33:19.949 [copycat-server-localhost/127.0.0.1:8012-copycat] INFO  i.a.catalyst.transport.NettyServer - Binding to localhost/127.0.0.1:8012
2016-03-15 11:33:20.057 [copycat-server-localhost/127.0.0.1:8012-copycat] INFO  i.a.catalyst.transport.NettyServer - Listening at /127.0.0.1:8012
2016-03-15 11:33:20.061 [copycat-server-localhost/127.0.0.1:8012-copycat] INFO  i.a.c.server.state.ServerContext - localhost/127.0.0.1:8012 - Transitioning to FOLLOWER
2016-03-15 11:33:21.544 [copycat-server-localhost/127.0.0.1:8012-copycat] INFO  i.a.c.server.state.ServerContext - localhost/127.0.0.1:8012 - Transitioning to CANDIDATE
2016-03-15 11:33:21.547 [copycat-server-localhost/127.0.0.1:8012-copycat] INFO  i.a.c.server.state.CandidateState - localhost/127.0.0.1:8012 - Starting election
2016-03-15 11:33:21.549 [copycat-server-localhost/127.0.0.1:8012-copycat] INFO  i.a.c.server.state.ServerContext - localhost/127.0.0.1:8012 - Transitioning to LEADER
2016-03-15 11:33:21.553 [copycat-server-localhost/127.0.0.1:8012-copycat] INFO  i.a.c.server.state.ServerContext - localhost/127.0.0.1:8012 - Found leader localhost/127.0.0.1:8012
2016-03-15 11:33:21.561 [copycat-server-localhost/127.0.0.1:8012-copycat] INFO  i.a.c.s.state.ServerStateMachine - localhost/127.0.0.1:8012 - Installing snapshot 1
2016-03-15 11:33:21.564 [copycat-server-localhost/127.0.0.1:8012-copycat] INFO  i.a.copycat.server.CopycatServer - Server started successfully!
2016-03-15 11:33:21.621 [copycat-client-2] INFO  i.a.c.client.session.ClientSession - Registered session 2
2016-03-15 11:33:54.828 [copycat-server-localhost/127.0.0.1:8012-copycat] ERROR i.a.c.u.c.SingleThreadContext - An uncaught exception occurred
io.atomix.catalyst.serializer.SerializationException: cannot serialize unregistered type: class io.atomix.group.state.GroupCommands$Listen
    at io.atomix.catalyst.serializer.Serializer.writeByClass(Serializer.java:895) ~[catalyst-serializer-1.0.4.jar:na]
    at io.atomix.catalyst.serializer.Serializer.writeObject(Serializer.java:869) ~[catalyst-serializer-1.0.4.jar:na]
    at io.atomix.resource.util.ResourceOperation.writeObject(ResourceOperation.java:52) ~[atomix-resource-manager-1.0.0-rc3.jar:na]
    at io.atomix.resource.util.ResourceCommand.writeObject(ResourceCommand.java:60) ~[atomix-resource-manager-1.0.0-rc3.jar:na]
    at io.atomix.catalyst.serializer.util.CatalystSerializableSerializer.write(CatalystSerializableSerializer.java:51) ~[catalyst-serializer-1.0.4.jar:na]
    at io.atomix.catalyst.serializer.util.CatalystSerializableSerializer.write(CatalystSerializableSerializer.java:45) ~[catalyst-serializer-1.0.4.jar:na]
    at io.atomix.catalyst.serializer.Serializer.writeById(Serializer.java:882) ~[catalyst-serializer-1.0.4.jar:na]
    at io.atomix.catalyst.serializer.Serializer.writeObject(Serializer.java:871) ~[catalyst-serializer-1.0.4.jar:na]
    at io.atomix.resource.util.InstanceOperation.writeObject(InstanceOperation.java:67) ~[atomix-resource-manager-1.0.0-rc3.jar:na]
    at io.atomix.catalyst.serializer.util.CatalystSerializableSerializer.write(CatalystSerializableSerializer.java:51) ~[catalyst-serializer-1.0.4.jar:na]
    at io.atomix.catalyst.serializer.util.CatalystSerializableSerializer.write(CatalystSerializableSerializer.java:45) ~[catalyst-serializer-1.0.4.jar:na]
    at io.atomix.catalyst.serializer.Serializer.writeById(Serializer.java:882) ~[catalyst-serializer-1.0.4.jar:na]
    at io.atomix.catalyst.serializer.Serializer.writeObject(Serializer.java:871) ~[catalyst-serializer-1.0.4.jar:na]
    at io.atomix.copycat.server.storage.entry.CommandEntry.writeObject(CommandEntry.java:79) ~[copycat-server-1.0.0-rc4.jar:na]
    at io.atomix.catalyst.serializer.util.CatalystSerializableSerializer.write(Cat
Any ideas?
(The Error is thrown on (.getGroup r "foo"))
Richard Pijnenburg
@electrical
Mar 15 2016 10:38
I did upgrade from RC2 to RC3 and had some issues due to a change in one of the files it barfed.
running tests on the master branch now. see if that shows anything
Richard Pijnenburg
@electrical
Mar 15 2016 10:44
btw, is that clojure you are writing it in ?
Richard Pijnenburg
@electrical
Mar 15 2016 12:13
Hmm. all tests pass on my side. and i do see the Listen class registered for the serializer.
Joachim De Beule
@joachimdb
Mar 15 2016 12:22
yes, clojure
Richard Pijnenburg
@electrical
Mar 15 2016 12:30
I’m unsure how the things are in clojure. but the tests pass
Richard Pijnenburg
@electrical
Mar 15 2016 12:36
@kuujo in continuation of our convo yesterday. https://nats.io/ what do you think of this using for sending across data to nodes?
to bad its writting in Go though
Joachim De Beule
@joachimdb
Mar 15 2016 15:44
the group tests do not use AtomixReplica/builder, they create servers in a more low-level way. Could that explains sth?
Richard Pijnenburg
@electrical
Mar 15 2016 15:50
Hmm. let me double check
shouldn’t matter to much
Ah. it uses the Copycat thing
hmm
that might explain it but not 100% sure. im sure @kuujo can elaborate on it more when he’s awake :-)
Joachim De Beule
@joachimdb
Mar 15 2016 15:54
k, thanks
Jordan Halterman
@kuujo
Mar 15 2016 16:40
Hmm
Resources are just Copycat StateMachines with a nice API, so the resource tests are written on Copycat clients/servers, however there are also versions of the same tests in core that do the getResource methods as well, so that is tested.
Serializable types are defined in TypeResolver at the bottom of this class, and the Listen type is registered.
But I wonder if there's a race condition here where the object is being serializes before it's registered
Richard Pijnenburg
@electrical
Mar 15 2016 17:06
possibly yeah
yay. have to do a fire extinguisher training :-)
im now one of the fire wardens at my new job
Jordan Halterman
@kuujo
Mar 15 2016 17:16
so… this was due to a change in how resources are loaded by Atomix
Richard Pijnenburg
@electrical
Mar 15 2016 17:16
ohw?
Jordan Halterman
@kuujo
Mar 15 2016 17:18

This will work:

AtomixReplica replica = AtomixReplica.builder(address, cluster)
  .withTransport(NettyTransport.builder().withThreads(4).build())
  .withResourceTypes(DistributedGroup.class)
  .build();

The resource types just aren’t being added to the type registry properly, and the way that all the tests are written hides that fact. I don’t think there’s any good reason not to add them though.

Joachim De Beule
@joachimdb
Mar 15 2016 19:39
should that work with rc3? Cause it says No matching method found: withResourceTypes for class io.atomix.AtomixReplica$Builder
note that I can get things working in rc2
grmbl
Jordan Halterman
@kuujo
Mar 15 2016 19:48
That's odd. The last commit was the release
Joachim De Beule
@joachimdb
Mar 15 2016 20:02
I didn't test the above in rc2 if that's what you mean, I don't need to as there is no Exception thrown in rc2
Jordan Halterman
@kuujo
Mar 15 2016 20:33
"should that work with rc3” yes it should, but not in rc2
Joachim De Beule
@joachimdb
Mar 15 2016 20:53
So you think this is on my end or rather sth to be fixed in rc3? And, out of curiosity, why .withthreads(4)?
Jordan Halterman
@kuujo
Mar 15 2016 20:54
that was just an example
I will fix this in Atomix
Joachim De Beule
@joachimdb
Mar 15 2016 20:54
k, great, thanks