Skip to content
This repository has been archived by the owner on Mar 16, 2022. It is now read-only.

Commit

Permalink
Upgraded to Akka 2.6.5
Browse files Browse the repository at this point in the history
  • Loading branch information
viktorklang committed May 3, 2020
1 parent 4fae978 commit 05b310d
Show file tree
Hide file tree
Showing 16 changed files with 216 additions and 222 deletions.
235 changes: 109 additions & 126 deletions build.sbt

Large diffs are not rendered by default.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ import java.util.concurrent.ConcurrentHashMap
final class ProtobufGeneratedMessageRegisterFeature extends Feature {
private[this] final val cache = ConcurrentHashMap.newKeySet[String]
final val messageClasses = Vector(
classOf[akka.protobuf.GeneratedMessage],
classOf[akka.protobuf.GeneratedMessage.Builder[_]],
classOf[akka.protobuf.ProtocolMessageEnum],
classOf[akka.protobufv3.internal.GeneratedMessageV3],
classOf[akka.protobufv3.internal.GeneratedMessageV3.Builder[_]],
classOf[akka.protobufv3.internal.ProtocolMessageEnum],
classOf[com.google.protobuf.GeneratedMessageV3],
classOf[com.google.protobuf.GeneratedMessageV3.Builder[_]],
classOf[com.google.protobuf.ProtocolMessageEnum],
Expand Down
6 changes: 2 additions & 4 deletions project/GraalVMPlugin.scala
Original file line number Diff line number Diff line change
Expand Up @@ -366,10 +366,8 @@ object GraalVMPlugin extends AutoPlugin {
if (dep.data.isFile) Some(dep)
else {
projectArts.find { art =>
(art.get(sbt.Keys.artifact.key), dep.get(sbt.Keys.artifact.key)) match {
case (Some(l), Some(r)) =>
l.name == r.name && l.classifier == r.classifier
case _ => false
art.get(sbt.Keys.artifact.key).zip(dep.get(sbt.Keys.artifact.key)) exists {
case (l, r) => l.name == r.name && l.classifier == r.classifier
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,9 @@
name: "akka.serialization.SerializationExtension$"
fields: [{name: "MODULE$"}]
}
{
name: "akka.serialization.Serialization"
}
{
name: "akka.util.ByteString$ByteString1"
}
Expand All @@ -279,19 +282,66 @@
name: "akka.util.ByteString$ByteStrings"
}
{
name: "akka.serialization.NullSerializer$"
allDeclaredConstructors: true
name: "akka.serialization.NullSerializer$"
allDeclaredConstructors: true
}
{
name: "akka.serialization.JavaSerializer"
allDeclaredConstructors: true
}
{
name: "akka.serialization.BooleanSerializer"
allDeclaredConstructors: true
}
{
name: "java.util.concurrent.TimeoutException"
}
{
name: "akka.serialization.JavaSerializer"
allDeclaredConstructors: true
name: "scala.Boolean"
}
{
name: "akka.serialization.BooleanSerializer"
allDeclaredConstructors: true
name: "java.lang.Boolean"
}
{
name: "akka.serialization.ByteArraySerializer"
allDeclaredConstructors: true
name: "akka.serialization.ByteArraySerializer"
allDeclaredConstructors: true
}
{
name: "akka.serialization.IntSerializer"
allDeclaredConstructors: true
}
{
name: "akka.serialization.LongSerializer"
allDeclaredConstructors: true
}
{
name: "akka.serialization.StringSerializer"
allDeclaredConstructors: true
}
{
name: "akka.serialization.ByteStringSerializer"
allDeclaredConstructors: true
}
{
name: "akka.serialization.DisabledJavaSerializer"
allDeclaredConstructors: true
}
{
name: "java.lang.Throwable"
}
{
name: "akka.actor.Address"
}
{
name: "akka.Done"
}
{
name: "akka.NotUsed"
}
{
name: "akka.actor.PoisonPill$"
}
{
name: "akka.actor.Kill$"
}
]
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@
allDeclaredFields: true
allDeclaredConstructors: true
}
{
name: "akka.remote.RemoteWatcher$Heartbeat$"
}
{
name: "akka.remote.RemoteScope"
}
Expand Down Expand Up @@ -69,4 +72,11 @@
name: "akka.remote.serialization.IntSerializer"
allDeclaredConstructors: true
}
{
name: "akka.remote.serialization.ThrowableNotSerializableException"
}
{
name: "akka.remote.UniqueAddress"
}

]
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@
name: "akka.stream.SystemMaterializer"
allDeclaredConstructors: true
}
{
name: "akka.stream.SystemMaterializer$"
allDeclaredConstructors: true
}
{
name: "akka.stream.impl.fusing.ActorGraphInterpreter"
allDeclaredFields: true
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Args = -H:ReflectionConfigurationResources=${.}/reflect-config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[
{
"name": "com.typesafe.sslconfig.ssl.NoopHostnameVerifier"
allDeclaredConstructors: true
}
]
14 changes: 11 additions & 3 deletions proxy/core/src/main/resources/cloudstate-common.conf
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
// Common configuration to be included by other impls

akka {
// FIXME library-extensions try to add a non-existent akka.stream.SystemMaterializer extension
library-extensions = ["akka.serialization.SerializationExtension"]
actor {
provider = cluster
allow-java-serialization = off
warn-about-java-serializer-usage = off
internal-dispatcher = akka.actor.default-dispatcher // FIXME consider removing this line
serializers {
crdt-serializers = "io.cloudstate.proxy.crdt.CrdtSerializers"
proto-any = "io.cloudstate.proxy.ProtobufAnySerializer"
Expand Down Expand Up @@ -39,6 +44,8 @@ akka {
artery {
enabled = on
transport = tcp
// FIXME do we need to set canonical.hostname?
// FIXME do we need to set advanced.tcp.connection-timeout?
canonical.port = ${?REMOTING_PORT}
bind.port = ${?REMOTING_PORT}
}
Expand All @@ -47,16 +54,17 @@ akka {
cluster {
shutdown-after-unsuccessful-join-seed-nodes = 60s

// FIXME consider settin distributed-data.max-delta-elements = <N>
// FIXME consider setting distributed-data.delta-crdt.max-delta-size = <N>

sharding.state-store-mode = ddata

// Non-durable for now, since we can't get native-image to work with lmdb right now
sharding.distributed-data.durable.keys = []

// fixme Of course, this is not ideal, but not much choice at the moment.
auto-down-unreachable-after = 30s

sharding {
rebalance-interval = 5s
passivate-idle-entity-after = off // FIXME put in a good value here
}

// Native image doesn't support JMX
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import akka.cluster.Cluster
import akka.management.cluster.bootstrap.ClusterBootstrap
import akka.management.scaladsl.AkkaManagement
import akka.pattern.{BackoffOpts, BackoffSupervisor}
import akka.stream.ActorMaterializer
import akka.stream.SystemMaterializer
import org.slf4j.LoggerFactory
import sun.misc.Signal

Expand Down Expand Up @@ -140,7 +140,7 @@ object CloudStateProxyMain {
}

implicit val system = configuration.fold(ActorSystem("cloudstate-proxy"))(c => ActorSystem("cloudstate-proxy", c))
implicit val materializer = ActorMaterializer()
implicit val materializer = SystemMaterializer(system)
import system.dispatcher

val c = system.settings.config.getConfig("cloudstate.proxy")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ import akka.cluster.singleton.{
ClusterSingletonProxySettings
}
import akka.grpc.GrpcClientSettings
import akka.stream.ActorMaterializer
import akka.stream.Materializer
import com.google.protobuf.DescriptorProtos
import com.google.protobuf.Descriptors.{FileDescriptor, ServiceDescriptor}
import com.typesafe.config.Config
Expand Down Expand Up @@ -119,7 +119,7 @@ object EntityDiscoveryManager {
}
}

def props(config: Configuration)(implicit mat: ActorMaterializer): Props =
def props(config: Configuration)(implicit mat: Materializer): Props =
Props(new EntityDiscoveryManager(config))

final case object Ready // Responds with true / false
Expand All @@ -138,7 +138,7 @@ object EntityDiscoveryManager {
}

class EntityDiscoveryManager(config: EntityDiscoveryManager.Configuration)(
implicit mat: ActorMaterializer
implicit mat: Materializer
) extends Actor
with ActorLogging {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package io.cloudstate.proxy.eventing

import akka.{Done, NotUsed}
import akka.actor.Cancellable
import akka.stream.{ActorMaterializer, FlowShape, OverflowStrategy}
import akka.stream.{FlowShape, Materializer, OverflowStrategy}
import akka.stream.scaladsl.{Flow, GraphDSL, Merge, Partition, RunnableGraph, Sink, Source}
import io.cloudstate.protocol.entity.{ClientAction, EntityDiscoveryClient, Failure, Reply, UserFunctionError}
import io.cloudstate.proxy.{Serve, UserFunctionRouter}
Expand Down Expand Up @@ -71,7 +71,7 @@ object EventingManager {
else List(EventMapping(entity, endpoints))
}

def createSupport(eventConfig: Config)(implicit materializer: ActorMaterializer): Option[EventingSupport] =
def createSupport(eventConfig: Config)(implicit materializer: Materializer): Option[EventingSupport] =
eventConfig.getString("support") match {
case "none" =>
log.info("Eventing support turned off in configuration")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import com.typesafe.config.{Config, ConfigFactory}
import akka.NotUsed
import akka.actor.{ActorSystem, Cancellable}
import akka.grpc.GrpcClientSettings
import akka.stream.ActorMaterializer
import akka.stream.Materializer
import akka.stream.scaladsl.{Flow, Keep, Sink, Source}
import io.cloudstate.proxy.Serve.CommandHandler
import io.cloudstate.proxy.EntityDiscoveryManager.ServableEntity
Expand Down Expand Up @@ -136,7 +136,7 @@ object GCPubsubEventingSupport {
final val USING_CRD = "using-crd"
}

class GCPubsubEventingSupport(config: Config, materializer: ActorMaterializer) extends EventingSupport {
class GCPubsubEventingSupport(config: Config, materializer: Materializer) extends EventingSupport {
import GCPubsubEventingSupport._

final val projectId: String = config.getString("project-id")
Expand Down
4 changes: 2 additions & 2 deletions tck/src/it/resources/application.conf
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ cloudstate-tck.combinations = [{
hostname = "127.0.0.1"
port = 9000
directory = ${user.dir}
//command = ["java","-Xmx512M", "-Xms128M", "-Dconfig.resource=in-memory.conf", "-Dcloudstate.proxy.dev-mode-enabled=true", "-jar", "proxy/core/target/scala-2.12/akka-proxy.jar"]
command = ["proxy/core/target/graalvm-native-image/cloudstate-proxy-core", "-Djava.library.path="${JAVA_HOME}"/lib", "-Dconfig.resource=in-memory.conf", "-Dcloudstate.proxy.dev-mode-enabled=true"]
command = ["java","-Xmx512M", "-Xms128M", "-Dconfig.resource=in-memory.conf", "-Dcloudstate.proxy.dev-mode-enabled=true", "-jar", "proxy/core/target/scala-2.12/akka-proxy.jar"]
//command = ["proxy/core/target/graalvm-native-image/cloudstate-proxy-core", "-Djava.library.path="${JAVA_HOME}"/lib", "-Dconfig.resource=in-memory.conf", "-Dcloudstate.proxy.dev-mode-enabled=true"]

env-vars {
USER_FUNCTION_PORT = "8090"
Expand Down
2 changes: 1 addition & 1 deletion tck/src/it/scala/io/cloudstate/tck/TCK.scala
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,6 @@ class TCK extends Suites({
iterator.
asScala.
filter(section => verify(section.getString("name"))).
map(c => new CloudStateTCK(CloudStateTCK.Configuration(c))).
map(c => new CloudStateTCK(TckConfiguration.fromConfig(c))).
toVector
}: _*) with SequentialNestedSuiteExecution

0 comments on commit 05b310d

Please sign in to comment.