zuston commented on code in PR #1534:
URL:
https://github.com/apache/incubator-uniffle/pull/1534#discussion_r1498628665
##########
server/src/main/java/org/apache/uniffle/server/ShuffleServerGrpcService.java:
##########
@@ -256,6 +256,7 @@ public void sendShuffleData(
final long start = System.currentTimeMillis();
List<ShufflePartitionedData> shufflePartitionedData =
toPartitionedData(req);
long alreadyReleasedSize = 0;
+ boolean hasFailureOccurred = false;
Review Comment:
This is not related with this PR. You can submit another PR to fix this.
##########
server/src/main/java/org/apache/uniffle/server/buffer/ShuffleBufferManager.java:
##########
@@ -80,11 +84,16 @@ public class ShuffleBufferManager {
protected Map<String, Map<Integer, AtomicLong>> shuffleSizeMap =
JavaUtils.newConcurrentMap();
public ShuffleBufferManager(ShuffleServerConf conf, ShuffleFlushManager
shuffleFlushManager) {
+ this.nettyServerEnabled = conf.get(ShuffleServerConf.RPC_SERVER_TYPE) ==
ServerType.GRPC_NETTY;
Review Comment:
This could be defined by the `ShuffleServer`
##########
server/src/main/java/org/apache/uniffle/server/buffer/ShuffleBufferManager.java:
##########
@@ -465,7 +493,17 @@ void requirePreAllocatedSize(long delta) {
}
public void releasePreAllocatedSize(long delta) {
- preAllocatedSize.addAndGet(-delta);
+ if (preAllocatedSize.get() >= delta) {
Review Comment:
it could be optimized by like this:
```
int allocated = preAllocatedSize.addAndGet(-delta);
if (allocated < 0) {
LOG.warn(
"Current pre-allocated memory["
+ preAllocatedSize.get()
+ "] is less than released["
+ delta
+ "], set pre-allocated memory to 0");
preAllocatedSize.set(0L);
}
```
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]