eloots / Pi-Akka-Cluster

Apache License 2.0
124 stars 33 forks source link

PR #130 breaks existing exercises #138

Closed eloots closed 4 years ago

eloots commented 4 years ago

@agolubev PR #130 breaks existing exercises. E.g. running exercise 60. Building runs fine (universal:packageBin). However, running the exercise on a node produces the following error:

$ ./run 60
Running exercise_060_cluster_base on node-1
10:18:49 INFO  [] - Slf4jLogger started
SLF4J: A number (1) of logging calls during the initialization phase have been intercepted and are
SLF4J: now being replayed. These are subject to the filtering rules of the underlying logging system.
SLF4J: See also http://www.slf4j.org/codes.html#replay
10:18:49 INFO  [ArteryTcpTransport(akka://pi-cluster-0-system)] - Remoting started with transport [Artery tcp]; listening on address [akka://pi-cluster-0-system@node-1:2550] with UID [3795535384498228207]
10:18:50 INFO  [Cluster(akka://pi-cluster-0-system)] - Cluster Node [akka://pi-cluster-0-system@node-1:2550] - Starting up, Akka version [2.6.1] ...
10:18:50 INFO  [Cluster(akka://pi-cluster-0-system)] - Cluster Node [akka://pi-cluster-0-system@node-1:2550] - Registered cluster JMX MBean [akka:type=Cluster]
10:18:50 INFO  [Cluster(akka://pi-cluster-0-system)] - Cluster Node [akka://pi-cluster-0-system@node-1:2550] - Started up successfully
10:18:50 INFO  [Cluster(akka://pi-cluster-0-system)] - Cluster Node [akka://pi-cluster-0-system@node-1:2550] - No downing-provider-class configured, manual cluster downing required, see https://doc.akka.io/docs/akka/current/typed/cluster.html#downing
10:18:50 WARN  [ManifestInfo(akka://pi-cluster-0-system)] - Detected possible incompatible versions on the classpath. Please note that a given Akka version MUST be the same across all modules of Akka that you are using, e.g. if you use [2.6.1] all other modules that are released together MUST be of the same version. Make sure you're using a compatible set of libraries. Possibly conflicting versions [2.6.1, 2.5.23] in libraries [akka-discovery:2.6.1, akka-coordination:2.6.1, akka-actor:2.6.1, akka-remote:2.6.1, akka-cluster-sharding-typed:2.6.1, akka-cluster:2.6.1, akka-protobuf-v3:2.6.1, akka-distributed-data:2.6.1, akka-cluster-typed:2.6.1, akka-cluster-tools:2.6.1, akka-persistence:2.6.1, akka-cluster-sharding:2.6.1, akka-actor-typed:2.6.1, akka-persistence-query:2.5.23, akka-slf4j:2.6.1, akka-persistence-typed:2.6.1, akka-stream:2.6.1]
Exception in thread "main" java.lang.IllegalStateException: Detected possible incompatible versions on the classpath. Please note that a given Akka version MUST be the same across all modules of Akka that you are using, e.g. if you use [2.6.1] all other modules that are released together MUST be of the same version. Make sure you're using a compatible set of libraries. Possibly conflicting versions [2.6.1, 2.5.23] in libraries [akka-discovery:2.6.1, akka-coordination:2.6.1, akka-actor:2.6.1, akka-remote:2.6.1, akka-cluster-sharding-typed:2.6.1, akka-cluster:2.6.1, akka-protobuf-v3:2.6.1, akka-distributed-data:2.6.1, akka-cluster-typed:2.6.1, akka-cluster-tools:2.6.1, akka-persistence:2.6.1, akka-cluster-sharding:2.6.1, akka-actor-typed:2.6.1, akka-persistence-query:2.5.23, akka-slf4j:2.6.1, akka-persistence-typed:2.6.1, akka-stream:2.6.1]
    at akka.util.ManifestInfo.checkSameVersion(ManifestInfo.scala:206)
    at akka.util.ManifestInfo.checkSameVersion(ManifestInfo.scala:173)
    at akka.actor.ActorSystemImpl.liftedTree2$1(ActorSystem.scala:1040)
    at akka.actor.ActorSystemImpl._start$lzycompute(ActorSystem.scala:1029)
    at akka.actor.ActorSystemImpl._start(ActorSystem.scala:1029)
    at akka.actor.ActorSystemImpl.start(ActorSystem.scala:1052)
    at akka.actor.typed.ActorSystem$.createInternal(ActorSystem.scala:278)
    at akka.actor.typed.ActorSystem$.apply(ActorSystem.scala:192)
    at akka.cluster.pi.ClusterStatusTrackerMain$.main(ClusterStatusTrackerMain.scala:46)
    at akka.cluster.pi.ClusterStatusTrackerMain.main(ClusterStatusTrackerMain.scala)
10:18:50 INFO  [Cluster(akka://pi-cluster-0-system)] - Cluster Node [akka://pi-cluster-0-system@node-1:2550] - Exiting completed
10:18:50 INFO  [Cluster(akka://pi-cluster-0-system)] - Cluster Node [akka://pi-cluster-0-system@node-1:2550] - Shutting down...
10:18:50 INFO  [Cluster(akka://pi-cluster-0-system)] - Cluster Node [akka://pi-cluster-0-system@node-1:2550] - Successfully shut down
10:18:52 INFO  [akka://pi-cluster-0-system@node-1:2550/system/remoting-terminator] - Shutting down remote daemon.
10:18:52 INFO  [akka://pi-cluster-0-system@node-1:2550/system/remoting-terminator] - Remote daemon shut down; proceeding with flushing remote transports.
10:18:53 INFO  [akka://pi-cluster-0-system@node-1:2550/system/remoting-terminator] - Remoting shut down.
HypriotOS/armv7: akkapi@node-1 in ~
$

I did a short investigation and it seems that the problem is caused by some incompatibilities in the code you added in the common project. When the code that was added in common is removed, the exercise is rebuilt and run, the exercise runs fine. It seems that some incompatibilities exist between the current dependencies and the ones that you added.

Can you please fix asap? Also, it is vital to check that existing exercises continue to function when applying changes. Please run tests on a cluster that allows testing this.

agolubev commented 4 years ago

The problem here is that the most recent version of akka-persistence-jdbc (3.5.3) has akka 2.5.23 in dependencies.

raboof commented 4 years ago

Adding an explicit dependency on akka-persistence-query 2.6.1 should fix this, and should be safe since we promise binary compatibility.

agolubev commented 4 years ago

@raboof thanks!

agolubev commented 4 years ago

@raboof is such kind of issue can be considered as a warning or an error? Log says it's warning level.

raboof commented 4 years ago

I agree it would be better to log this at ERROR level, as by default the actor system will not complete its startup when incompatibilities are found.

agolubev commented 4 years ago

Verified #140 with lab 60 and 101 so this should cover both configurations

eloots commented 4 years ago

@agolubev I verified that the fix works! Thanks! (cc: @raboof) Closing issue