=typ initialize ActorRefResolver lazily in MiscMessageSerializer
Serializers are initialized early on even before the underlying untyped ActorSystem is fully initialized. Accessing extensions might trigger a chain of initialization that might step on uninitialized internal bits later on.
This commit is contained in:
parent
b90a1166ef
commit
0c1ee2f4a8
1 changed files with 2 additions and 1 deletions
|
|
@ -14,7 +14,8 @@ import akka.serialization.{ BaseSerializer, SerializerWithStringManifest }
|
|||
@InternalApi
|
||||
class MiscMessageSerializer(val system: akka.actor.ExtendedActorSystem) extends SerializerWithStringManifest with BaseSerializer {
|
||||
|
||||
private val resolver = ActorRefResolver(system.toTyped)
|
||||
// Serializers are initialized early on. `toTyped` might then try to initialize the untyped ActorSystemAdapter extension.
|
||||
private lazy val resolver = ActorRefResolver(system.toTyped)
|
||||
private val ActorRefManifest = "a"
|
||||
|
||||
def manifest(o: AnyRef): String = o match {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue