jerqi commented on code in PR #1605:
URL:
https://github.com/apache/incubator-uniffle/pull/1605#discussion_r1540851364
##########
server/src/main/java/org/apache/uniffle/server/netty/ShuffleServerNettyHandler.java:
##########
@@ -459,29 +463,27 @@ public void handleGetLocalShuffleData(TransportClient
client, GetLocalShuffleDat
storageType,
offset,
length);
- long readTime = System.currentTimeMillis() - start;
- ShuffleServerMetrics.counterTotalReadTime.inc(readTime);
ShuffleServerMetrics.counterTotalReadDataSize.inc(sdr.getDataLength());
ShuffleServerMetrics.counterTotalReadLocalDataFileSize.inc(sdr.getDataLength());
- shuffleServer
- .getNettyMetrics()
- .recordProcessTime(GetLocalShuffleDataRequest.class.getName(),
readTime);
- LOG.info(
- "Successfully getShuffleData cost {} ms for shuffle" + " data with
{}",
- readTime,
- requestInfo);
response =
new GetLocalShuffleDataResponse(
req.getRequestId(), status, msg, sdr.getManagedBuffer());
+ ReleaseMemoryAndRecordReadTimeListener listener =
+ new ReleaseMemoryAndRecordReadTimeListener(
+ start, length, sdr.getDataLength(), requestInfo, req, client);
+ client.getChannel().writeAndFlush(response).addListener(listener);
+ return;
} catch (Exception e) {
+ shuffleServer.getShuffleBufferManager().releaseReadMemory(length);
Review Comment:
I have some concern about this. Will it release twice? Because maybe
completelistener will release memory when it throws exception.
--
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]