Copilot commented on code in PR #3717:
URL: https://github.com/apache/celeborn/pull/3717#discussion_r3344528499
##########
client/src/main/scala/org/apache/celeborn/client/commit/ReducePartitionCommitHandler.scala:
##########
@@ -103,7 +103,7 @@ class ReducePartitionCommitHandler(
// noinspection UnstableApiUsage
private val getReducerFileGroupRpcCache: Cache[Int, ByteBuffer] =
CacheBuilder.newBuilder()
.concurrencyLevel(rpcCacheConcurrencyLevel)
- .expireAfterWrite(rpcCacheExpireTime, TimeUnit.MILLISECONDS)
+ .expireAfterAccess(rpcCacheExpireTime, TimeUnit.MILLISECONDS)
.maximumSize(rpcCacheSize)
.build().asInstanceOf[Cache[Int, ByteBuffer]]
Review Comment:
The cache key is only `shuffleId`, but the cached value is a serialized
`ByteBuffer` whose encoding depends on `serdeVersion` (embedded in
`GetReducerFileGroupResponse` and used by `JavaSerializerInstance.serialize`
via `Utils.toTransportMessage`). With `expireAfterAccess`, a hot shuffle can
keep a V1 (or V2) serialized response alive indefinitely, causing callers with
a different `serdeVersion` to receive bytes for the wrong protocol version.
Consider keying the cache by `(shuffleId, serdeVersion)` (or maintaining
separate caches per serdeVersion), or caching the logical
`GetReducerFileGroupResponse` and serializing per-request based on
`serdeVersion`.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]