pulsar icon indicating copy to clipboard operation
pulsar copied to clipboard

Cannot run the cluster ping/pong example

Open hellonico opened this issue 9 years ago • 5 comments

Running the cluster ping pong example either lead to:

WARNING: fiber Fiber@10000001:fiber-10000001[task: ParkableForkJoinTask@d758092(Fiber@10000001), target: co.paralleluniverse.actors.ActorRunner@65c19b15, scheduler: co.paralleluniverse.fibers.FiberForkJoinScheduler@30638489] is hogging the CPU or blocking a thread.

or (on the pong side)

WARNING: Uninstrumented methods (marked '**') or call-sites (marked '!!') detected on the call stack: 
    at co.paralleluniverse.remote.galaxy.GlxGlobalRegistry.register(co.paralleluniverse.actors.Actor,co.paralleluniverse.actors.ActorRef) (GlxGlobalRegistry.java:89 bci: 779) !! (instrumented suspendable calls at: [])
    at co.paralleluniverse.actors.ActorRegistry.register (ActorRegistry.java:52 bci: 244)
    at co.paralleluniverse.actors.Actor.register (Actor.java:983 bci: 108)

followed by: (on the ping side)

14:31:42.092 [pool-8-thread-1]                     core.Cache [WARN ] {} TIMEOUT: Op.GET(line:3497f8, data:co.paralleluniverse.galaxy.core.StringRootManager$StringRootPageHandler@4da33907) 
14:31:42.095 [main]       galaxy.GlxGlobalRegistry [ERROR] {} Getting actor pong failed due to timeout 
Exception in thread "main" java.lang.RuntimeException: Actor discovery failed, compiling:(/private/var/folders/j0/cj4y4dyn5xjfcf9shts0d7tr0000gn/T/form-init8487154891595077328.clj:1:125)
    at clojure.lang.Compiler.load(Compiler.java:7239)
    at clojure.lang.Compiler.loadFile(Compiler.java:7165)
    at clojure.main$load_script.invoke(main.clj:275)
    at clojure.main$init_opt.invoke(main.clj:280)
    at clojure.main$initialize.invoke(main.clj:308)
    at clojure.main$null_opt.invoke(main.clj:343)
    at clojure.main$main.doInvoke(main.clj:421)
    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.RuntimeException: Actor discovery failed
    at co.paralleluniverse.remote.galaxy.GlxGlobalRegistry.getActor0(GlxGlobalRegistry.java:255)
    at co.paralleluniverse.remote.galaxy.GlxGlobalRegistry.getActor(GlxGlobalRegistry.java:156)
    at co.paralleluniverse.actors.ActorRegistry.getActor(ActorRegistry.java:83)
    at co.paralleluniverse.actors.ActorRegistry.getActor(ActorRegistry.java:93)
    at co.paralleluniverse.pulsar.actors$whereis.invoke(actors.clj:386)
    at co.paralleluniverse.pulsar.examples.cluster.ping$_main.invoke(ping.clj:18)
    at clojure.lang.Var.invoke(Var.java:375)
    at user$eval5.invoke(form-init8487154891595077328.clj:1)
    at clojure.lang.Compiler.eval(Compiler.java:6782)
    at clojure.lang.Compiler.eval(Compiler.java:6772)
    at clojure.lang.Compiler.load(Compiler.java:7227)
    ... 11 more

This using the peer.xml configuration .... with its different versions (server, no server, dumb server, zookeeper, jgroups ...). I tried to run ping pong on the same machine, or two different machines.

Any idea on how to configure this to work ? I am not trying to tweak configurations, but just getting this to run.

Eventually, for the project I am working on, I would like to run pulsar actors on two different machines.

hellonico avatar Mar 24 '16 03:03 hellonico

Hi. I'll take a look and get back to you on this next week, but at any rate, at this point in time we are not recommending the use of Galaxy (which is undergoing a major revamp) as a clustering solution for Quasar/Pulsar in production just yet (a couple more months). For production use in the immediate future, please use any messaging solution (e.g. Kafka) to distribute Quasar.

pron avatar Mar 24 '16 10:03 pron

For production use in the immediate future, please use any messaging solution (e.g. Kafka) to distribute Quasar.

Any sample project showing quickly how to achieve this ? (nothing fancy, just a headstart)

hellonico avatar Mar 25 '16 02:03 hellonico

Hi, the core idea is pretty straightforward: just send to the messaging solution and receive from it rather than sending/receiving between actors. The rest is a matter of interfacing the message broker in the most efficient way, that is avoiding blocking fiber pool threads and avoiding blocking threads at all (if at all possible with the broker's drivers). To this extent Comsat includes a community-contributed fiber-blocking Kafka async producer integration that you can use on the sending side. On the receiving side you could have, for example, one or few thread-based consumer actors polling Kafka and relaying messages to the intended recipient fiber-based actors.

I suggest you just go ahead and try. I'll add that the Kafka integration code, tests and docs are a good start, although not comprehensive; some more comprehensive examples and tutorials are coming soon though, and in fact it's one of the things we're working on at present.

There's also a discussion about integrating Camel that you might be interested in as it is a strictly related topic.

circlespainter avatar Mar 29 '16 14:03 circlespainter

I'll add that you could add some relaying actors on the sending side as well: in such a way the application actors won't see any difference between messaging directly and messaging through the message broker.

circlespainter avatar Mar 29 '16 14:03 circlespainter

@hellonico There's a new post about Quasar actors integration with Kafka and ZeroMQ that can be interesting: http://blog.paralleluniverse.co/2016/04/14/quasar-actors-kafka-zeromq/

circlespainter avatar Apr 14 '16 15:04 circlespainter