You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pekko.apache.org by fa...@apache.org on 2026/09/02 11:58:47 UTC
(pekko) branch main updated: docs: fix comment placement around serialization-max-nesting-depth (#3511)
This is an automated email from the ASF dual-hosted git repository.
pjfanning pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/pekko.git
The following commit(s) were added to refs/heads/main by this push:
new 12d3d85260 docs: fix comment placement around serialization-max-nesting-depth (#3511)
12d3d85260 is described below
commit 12d3d852604f643ebbac4e429c47f637fb8791d6
Author: PJ Fanning <pj...@users.noreply.github.com>
AuthorDate: Wed Sep 2 12:58:41 2026 +0100
docs: fix comment placement around serialization-max-nesting-depth (#3511)
* fix: keep allow-java-serialization comment attached to its setting
* docs: note why the depth counter is a one-element Array[Int]
---
actor/src/main/resources/reference.conf | 4 ++--
.../scala/org/apache/pekko/serialization/NestedDeserialization.scala | 2 ++
2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/actor/src/main/resources/reference.conf b/actor/src/main/resources/reference.conf
index 1f83d9ed23..3f7bf3118c 100644
--- a/actor/src/main/resources/reference.conf
+++ b/actor/src/main/resources/reference.conf
@@ -822,6 +822,8 @@ pekko {
#
# Please note that this option does not stop you from manually invoking java serialization
#
+ allow-java-serialization = off
+
# Maximum nesting depth when a serialized payload encloses another serialized
# payload (for example Some, Optional, Status.Failure, StatusReply, a Throwable
# cause, or an ActorSelectionMessage). Each level is parsed separately, so this is
@@ -829,8 +831,6 @@ pekko {
# NotSerializableException rather than failing with a StackOverflowError.
serialization-max-nesting-depth = 32
- allow-java-serialization = off
-
# Log warnings when the Java serialization is used to serialize messages.
# Java serialization is not very performant and should not be used in production
# environments unless you don't care about performance and security. In that case
diff --git a/actor/src/main/scala/org/apache/pekko/serialization/NestedDeserialization.scala b/actor/src/main/scala/org/apache/pekko/serialization/NestedDeserialization.scala
index d2863ecf7b..d4d63dedcb 100644
--- a/actor/src/main/scala/org/apache/pekko/serialization/NestedDeserialization.scala
+++ b/actor/src/main/scala/org/apache/pekko/serialization/NestedDeserialization.scala
@@ -38,6 +38,8 @@ import org.apache.pekko.annotation.InternalApi
@InternalApi
private[pekko] object NestedDeserialization {
+ // a one-element Array[Int] serves as a mutable int holder, so incrementing the
+ // depth does not box the way a ThreadLocal[Int] would on every get/set
private val depth = new ThreadLocal[Array[Int]] {
override def initialValue(): Array[Int] = new Array[Int](1)
}
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pekko.apache.org
For additional commands, e-mail: commits-help@pekko.apache.org