These are chat archives for atomix/atomix

31st
Jul 2018
william.z
@zwillim
Jul 31 2018 10:47

I found something interesting during my test.

  1. Each server only accept 2 msgs at the same time , by MessageService.
  2. Each msg wait for only 5s, and then timeout.

How can I change the limits?
BTW, my server is like this:

        atomix.getMessagingService().registerHandler("test_type", (Address addr, byte[] bs) -> {
            System.out.println("coming in test_type, addr:" + addr + ", cmd:" + new String(bs));
            try {
                Thread.sleep(1000);
            } catch (InterruptedException ex) {
            }
            return ("return_" + i.getAndIncrement() + "_" + new String(bs) + "_from_" + server).getBytes();
        }, new ThreadPoolExecutor(2, 32, 3, TimeUnit.SECONDS, new ArrayBlockingQueue<>(32), (r, e) -> r.run()));
Johno Crawford
@johnou
Jul 31 2018 13:05
Could be the phi failure detector
You shouldn't have that sleep there
Jordan Halterman
@kuujo
Jul 31 2018 17:08
It’s fine to sleep as long as you provide an Executor and block your own threads. But there’s no such limit on the number of messages that can be received. What about the node sending the messages?
Impossible to tell what’s going on without the other half of the code
Also, I’d suggest using the ClusterCommunicationService so you don’t have to send raw bytes to raw Addresses
Jordan Halterman
@kuujo
Jul 31 2018 17:14
Actually, looks almost like the code from before so nvm
Jordan Halterman
@kuujo
Jul 31 2018 18:36

@zwillim

    AtomicInteger count = new AtomicInteger();
    netty1.registerHandler("test_type", (Address addr, byte[] bs) -> {
      System.out.println("coming in test_type, addr:" + addr + ", cmd:" + new String(bs));
      try {
        Thread.sleep(1000);
      } catch (InterruptedException e) {

      }
      return ("return_" + count.incrementAndGet() + "_" + new String(bs) + "_from_" + 1).getBytes();
    }, new ThreadPoolExecutor(2, 32, 3, TimeUnit.SECONDS, new ArrayBlockingQueue<>(32), (r, e) -> r.run()));

    for (int i = 0; i < 100; i++) {
      netty2.sendAndReceive(ep1, "test_type", "Hello world!".getBytes()).thenAccept(response -> {
        System.out.println(new String(response));
      });
    }

This works fine. Just uses 32 threads so handles 32 requests at a time.

Jordan Halterman
@kuujo
Jul 31 2018 19:59
that other code was doing something really expensive before sending a message, so I’d also log the rate at which the messages were actually being sent too
Jordan Halterman
@kuujo
Jul 31 2018 20:51
going to release rc6 today
I've had to bring in the Maven wrapper to force 3.5.0..
Jordan Halterman
@kuujo
Jul 31 2018 23:19
After the release we should probably explore parallel test execution. The problem we’ll have is the port bindings in tests
But the tests are currently way, way too slow
We’ve been moving ONOS to Bazel. If they can’t be substantially improved we can do something like that