CodingCat commented on code in PR #2462:
URL: https://github.com/apache/celeborn/pull/2462#discussion_r1569173904
##########
client/src/main/scala/org/apache/celeborn/client/ChangePartitionManager.scala:
##########
@@ -151,7 +156,7 @@ class ChangePartitionManager(
oldPartition,
cause)
- requests.synchronized {
+ locks(partitionId % locks.length).synchronized {
if (requests.containsKey(partitionId)) {
requests.get(partitionId).add(changePartition)
logTrace(s"[handleRequestPartitionLocation] For $shuffleId, request
for same partition" +
Review Comment:
```scala
requests.putIfAbsent(partitionId, set)
requests.get(partitionId).synchronized {
getLatestPartition(shuffleId, partitionId, oldEpoch).foreach { latestLoc =>
context.reply(
partitionId,
StatusCode.SUCCESS,
Some(latestLoc),
lifecycleManager.workerStatusTracker.workerAvailable(oldPartition))
logDebug(s"New partition found, old partition $partitionId-$oldEpoch
return it." +
s" shuffleId: $shuffleId $latestLoc")
return
}
requests.get(partitionId).add(changePartition)
}
```
this was my original code, somehow this makes the application stuck , that's
why I feel somehow this putIfAbsent approach changed the original semantics in
a stealthy way
--
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]