Config to exclude class prefix from serialize-messages, #24273 (#27517)

* Config to exclude class prefix from serialize-messages, #24273

* Adding no-serialization-verification-needed-class-prefix, with "akka." included
  by default
* This is important now when we disable Java serialization by default.
  There will be many complaints about Akka internal classes that are not marked with
  NoSerializationVerificationNeeded, and we can't really sprinkle that everywhere.
* Not removing NoSerializationVerificationNeeded usage in Akka classes because that
  may break bin compat, even though it's needed any more.

* fix DisabledJavaSerializerWarningSpec
This commit is contained in:
Patrik Nordwall 2019-09-26 22:51:12 +02:00 committed by GitHub
parent 4f9a4b5403
commit a7c43cf573
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
100 changed files with 105 additions and 235 deletions

View file

@ -120,7 +120,7 @@ object Replicator {
replyTo: ActorRef[GetResponse[A]])
extends Command
@DoNotInherit sealed abstract class GetResponse[A <: ReplicatedData] extends NoSerializationVerificationNeeded {
@DoNotInherit sealed abstract class GetResponse[A <: ReplicatedData] {
def key: Key[A]
}
@ -180,8 +180,7 @@ object Replicator {
key: Key[A],
writeConsistency: WriteConsistency,
replyTo: ActorRef[UpdateResponse[A]])(val modify: Option[A] => A)
extends Command
with NoSerializationVerificationNeeded {
extends Command {
/**
* Modify value of local `Replicator` and replicate with given `writeConsistency`.
@ -200,7 +199,7 @@ object Replicator {
}
@DoNotInherit sealed abstract class UpdateResponse[A <: ReplicatedData] extends NoSerializationVerificationNeeded {
@DoNotInherit sealed abstract class UpdateResponse[A <: ReplicatedData] {
def key: Key[A]
}
final case class UpdateSuccess[A <: ReplicatedData](key: Key[A]) extends UpdateResponse[A] with DeadLetterSuppression
@ -312,9 +311,8 @@ object Replicator {
consistency: WriteConsistency,
replyTo: ActorRef[DeleteResponse[A]])
extends Command
with NoSerializationVerificationNeeded
sealed trait DeleteResponse[A <: ReplicatedData] extends NoSerializationVerificationNeeded {
sealed trait DeleteResponse[A <: ReplicatedData] {
def key: Key[A]
}
final case class DeleteSuccess[A <: ReplicatedData](key: Key[A]) extends DeleteResponse[A]

View file

@ -4,8 +4,6 @@
package akka.cluster.ddata.typed.scaladsl
import akka.actor.NoSerializationVerificationNeeded
import akka.cluster.{ ddata => dd }
import akka.cluster.ddata.Key
import akka.cluster.ddata.ReplicatedData
@ -145,7 +143,6 @@ object Replicator {
writeConsistency: WriteConsistency,
replyTo: ActorRef[UpdateResponse[A]])(val modify: Option[A] => A)
extends Command
with NoSerializationVerificationNeeded {}
type UpdateResponse[A <: ReplicatedData] = dd.Replicator.UpdateResponse[A]
type UpdateSuccess[A <: ReplicatedData] = dd.Replicator.UpdateSuccess[A]
@ -282,7 +279,6 @@ object Replicator {
consistency: WriteConsistency,
replyTo: ActorRef[DeleteResponse[A]])
extends Command
with NoSerializationVerificationNeeded
type DeleteResponse[A <: ReplicatedData] = dd.Replicator.DeleteResponse[A]
type DeleteSuccess[A <: ReplicatedData] = dd.Replicator.DeleteSuccess[A]

View file

@ -4,7 +4,6 @@
package akka.cluster.typed
import akka.actor.NoSerializationVerificationNeeded
import akka.annotation.{ DoNotInherit, InternalApi }
import akka.cluster.ClusterSettings.DataCenter
import akka.cluster.singleton.{
@ -50,8 +49,7 @@ final class ClusterSingletonSettings(
val singletonIdentificationInterval: FiniteDuration,
val removalMargin: FiniteDuration,
val handOverRetryInterval: FiniteDuration,
val bufferSize: Int)
extends NoSerializationVerificationNeeded {
val bufferSize: Int) {
def withRole(role: String): ClusterSingletonSettings = copy(role = Some(role))
@ -270,8 +268,7 @@ final class ClusterSingletonManagerSettings(
val singletonName: String,
val role: Option[String],
val removalMargin: FiniteDuration,
val handOverRetryInterval: FiniteDuration)
extends NoSerializationVerificationNeeded {
val handOverRetryInterval: FiniteDuration) {
def withSingletonName(name: String): ClusterSingletonManagerSettings = copy(singletonName = name)

View file

@ -26,10 +26,7 @@ public class ClusterApiTest extends JUnitSuite {
+ "akka.remote.artery.canonical.hostname = 127.0.0.1 \n"
+ "akka.cluster.jmx.multi-mbeans-in-same-jvm = on \n"
+ "akka.coordinated-shutdown.terminate-actor-system = off \n"
+ "akka.coordinated-shutdown.run-by-actor-system-terminate = off \n"
+ "akka.actor { \n"
+ " serialize-messages = off \n"
+ "}");
+ "akka.coordinated-shutdown.run-by-actor-system-terminate = off \n");
ActorSystem<?> system1 =
ActorSystem.wrap(akka.actor.ActorSystem.create("ClusterApiTest", config));

View file

@ -26,9 +26,6 @@ object ClusterApiSpec {
akka.cluster.jmx.multi-mbeans-in-same-jvm = on
akka.coordinated-shutdown.terminate-actor-system = off
akka.coordinated-shutdown.run-by-actor-system-terminate = off
akka.actor {
serialize-messages = off
}
# generous timeout for cluster forming probes
akka.actor.testkit.typed.default-timeout = 10s
# disable this or we cannot be sure to observe node end state on the leaving side

View file

@ -26,7 +26,6 @@ object ClusterSingletonApiSpec {
val config = ConfigFactory.parseString(s"""
akka.actor {
provider = cluster
serialize-messages = off
serializers {
test = "akka.cluster.typed.ClusterSingletonApiSpec$$PingSerializer"

View file

@ -23,10 +23,6 @@ object ClusterSingletonPersistenceSpec {
akka.coordinated-shutdown.terminate-actor-system = off
akka.coordinated-shutdown.run-by-actor-system-terminate = off
akka.actor {
serialize-messages = off
}
akka.persistence.journal.plugin = "akka.persistence.journal.inmem"
""".stripMargin)

View file

@ -49,7 +49,6 @@ object RemoteContextAskSpec {
loglevel = debug
actor {
provider = cluster
serialize-creators = off
serializers {
test = "akka.cluster.typed.RemoteContextAskSpecSerializer"
}

View file

@ -21,7 +21,6 @@ object RemoteDeployNotAllowedSpec {
loglevel = warning
actor {
provider = cluster
serialize-creators = off
}
remote.classic.netty.tcp.port = 0
remote.artery {

View file

@ -37,7 +37,6 @@ object RemoteMessageSpec {
loglevel = debug
actor {
provider = cluster
serialize-creators = off
serializers {
test = "akka.cluster.typed.PingSerializer"
}

View file

@ -31,7 +31,6 @@ object ClusterReceptionistSpec {
akka.loglevel = DEBUG # issue #24960
akka.actor {
provider = cluster
serialize-messages = off
serializers {
test = "akka.cluster.typed.internal.receptionist.ClusterReceptionistSpec$$PingSerializer"
}