Skip to content

cherry-pick fix(deps): pin kryo to 4.0.2 to restore IdentityObjectIntMap.clear fix (kryo #558/#549) - #2311

Merged
amolnayak311 merged 1 commit into
filodb:integrationfrom
amolnayak311:kryo-4.0.2-backport-integration
Jul 16, 2026
Merged

cherry-pick fix(deps): pin kryo to 4.0.2 to restore IdentityObjectIntMap.clear fix (kryo #558/#549)#2311
amolnayak311 merged 1 commit into
filodb:integrationfrom
amolnayak311:kryo-4.0.2-backport-integration

Conversation

@amolnayak311

Copy link
Copy Markdown
Contributor

No description provided.

…x (kryo filodb#558/filodb#549)

The Scala 2.13 upgrade left kryo resolving to 4.0.0 in the assembly. Two
differently-named kryo artifacts coexist on the classpath — plain
`com.esotericsoftware:kryo` (from de.javakaffee:kryo-serializers + the
direct pin) and `com.esotericsoftware:kryo-shaded:4.0.2` (via chill).
sbt does not evict across different artifact names, and sbt-assembly's
`MergeStrategy.first` for `com.esotericsoftware.**` arbitrarily selected
the plain `kryo:4.0.0` classes in the newer build.

kryo 4.0.0 predates fix filodb#558/filodb#549 ("IdentityObjectIntMap.clear taking
more time — Realloc instead of clearing large maps"):
MapReferenceResolver.reset()/DefaultClassResolver.reset() call `clear()`
(walks the entire retained backing array) instead of `clear(2048)`
(realloc/shrink). On query fan-in (aggregator) nodes the pooled Kryo
reference map never shrinks after a large result, so every subsequent
reset() is O(peak-capacity) — observed as a hot IdentityObjectIntMap.clear()
in JFR profiles plus retained-map GC pressure.

Pinning `kryo` to 4.0.2 evicts the 4.0.0 copy so both `kryo` and
`kryo-shaded` resolve to 4.0.2; verified the built assembly's
MapReferenceResolver.reset() now uses clear(2048).

(cherry picked from commit ebdf9e9)
@amolnayak311
amolnayak311 merged commit 9219718 into filodb:integration Jul 16, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants