You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@uniffle.apache.org by "lwllvyb (via GitHub)" <gi...@apache.org> on 2024/09/10 07:02:45 UTC
[PR] fix[server] Fix duplicate blockId cause netty memory leak [incubator-uniffle]
lwllvyb opened a new pull request, #2106:
URL: https://github.com/apache/incubator-uniffle/pull/2106
### What changes were proposed in this pull request?
Fix duplicated blockId cause shuffle server memory leak in netty mode.
### Why are the changes needed?
Fix: #2105
### Does this PR introduce _any_ user-facing change?
(Please list the user-facing changes introduced by your change, including
1. Change in user-facing APIs.
2. Addition or removal of property keys.)
No.
### How was this patch tested?
(Please test your changes, and provide instructions on how to test it:
1. If you add a feature or fix a bug, add a test to cover your changes.
2. If you fix a flaky test, repeat it for many times to prove it works.)
--
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: issues-unsubscribe@uniffle.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@uniffle.apache.org
For additional commands, e-mail: issues-help@uniffle.apache.org
Re: [PR] fix[server] Fix duplicate blockId cause netty memory leak [incubator-uniffle]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #2106:
URL: https://github.com/apache/incubator-uniffle/pull/2106#issuecomment-2339878449
## Test Results
2 807 files ±0 2 807 suites ±0 5h 53m 44s :stopwatch: +24s
992 tests ±0 991 :white_check_mark: +1 1 :zzz: ±0 0 :x: ±0
12 463 runs ±0 12 448 :white_check_mark: +1 15 :zzz: ±0 0 :x: ±0
Results for commit 98577d59. ± Comparison against base commit a6aefcb3.
[test-results]:data:application/gzip;base64,H4sIAN7032YC/03MRw7DIBCF4atYrLOgDC2XiTBFQrFNhGEV5e4By235vhn9XxTi5Ff0HKjC8jGgtcZy365mU2JauhBKoVG7l/6hNT3Wa63WbkQuesdPowuCiVMDfILPOeVdcl16k1AQbJ9HtBmo0/YqP+BW3fY9atM8x9IG0opL6bgGDMIZZiDQQLAcBTgPbDQsaAmBMPT7A7voCzkSAQAA
--
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: issues-unsubscribe@uniffle.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@uniffle.apache.org
For additional commands, e-mail: issues-help@uniffle.apache.org
Re: [PR] fix[server] Fix duplicate blockId cause netty memory leak [incubator-uniffle]
Posted by "zhengchenyu (via GitHub)" <gi...@apache.org>.
zhengchenyu commented on PR #2106:
URL: https://github.com/apache/incubator-uniffle/pull/2106#issuecomment-2371130547
> But I haven't found the `getNextSeqNo` will invoked by multi thread at the same time.
I also think getNextSeqNo will not be invoked by multi thread at the same time.
I also encounter this problem for tez. I think maybe sendShuffleData was retried. We should also remove duplicates on the server side.
--
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: issues-unsubscribe@uniffle.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@uniffle.apache.org
For additional commands, e-mail: issues-help@uniffle.apache.org
Re: [PR] fix[server] Fix duplicate blockId cause netty memory leak [incubator-uniffle]
Posted by "zuston (via GitHub)" <gi...@apache.org>.
zuston commented on code in PR #2106:
URL: https://github.com/apache/incubator-uniffle/pull/2106#discussion_r1751478504
##########
client-spark/common/src/main/java/org/apache/spark/shuffle/writer/WriteBufferManager.java:
##########
@@ -413,10 +414,9 @@ protected ShuffleBlockInfo createShuffleBlock(int partitionId, WriterBuffer wb)
// it's run in single thread, and is not thread safe
Review Comment:
Is this comment incorrect? Could you help describe more about this bug? @lwllvyb
--
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: issues-unsubscribe@uniffle.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@uniffle.apache.org
For additional commands, e-mail: issues-help@uniffle.apache.org
Re: [PR] fix[server] Fix duplicate blockId cause netty memory leak [incubator-uniffle]
Posted by "zuston (via GitHub)" <gi...@apache.org>.
zuston merged PR #2106:
URL: https://github.com/apache/incubator-uniffle/pull/2106
--
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: issues-unsubscribe@uniffle.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@uniffle.apache.org
For additional commands, e-mail: issues-help@uniffle.apache.org
Re: [PR] fix[server] Fix duplicate blockId cause netty memory leak [incubator-uniffle]
Posted by "zuston (via GitHub)" <gi...@apache.org>.
zuston commented on code in PR #2106:
URL: https://github.com/apache/incubator-uniffle/pull/2106#discussion_r1751753594
##########
client-spark/common/src/main/java/org/apache/spark/shuffle/writer/WriteBufferManager.java:
##########
@@ -413,10 +414,9 @@ protected ShuffleBlockInfo createShuffleBlock(int partitionId, WriterBuffer wb)
// it's run in single thread, and is not thread safe
Review Comment:
I'm OK for this code change because it looks reasonable. But I hope we could find the root cause
--
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: issues-unsubscribe@uniffle.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@uniffle.apache.org
For additional commands, e-mail: issues-help@uniffle.apache.org
Re: [PR] fix[server] Fix duplicate blockId cause netty memory leak [incubator-uniffle]
Posted by "lwllvyb (via GitHub)" <gi...@apache.org>.
lwllvyb commented on code in PR #2106:
URL: https://github.com/apache/incubator-uniffle/pull/2106#discussion_r1751519684
##########
client-spark/common/src/main/java/org/apache/spark/shuffle/writer/WriteBufferManager.java:
##########
@@ -413,10 +414,9 @@ protected ShuffleBlockInfo createShuffleBlock(int partitionId, WriterBuffer wb)
// it's run in single thread, and is not thread safe
Review Comment:
> Is this comment incorrect? Could you help describe more about this bug? @lwllvyb
Base on the test results, this comment is incorrect.
--
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: issues-unsubscribe@uniffle.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@uniffle.apache.org
For additional commands, e-mail: issues-help@uniffle.apache.org
Re: [PR] fix[server] Fix duplicate blockId cause netty memory leak [incubator-uniffle]
Posted by "lwllvyb (via GitHub)" <gi...@apache.org>.
lwllvyb commented on PR #2106:
URL: https://github.com/apache/incubator-uniffle/pull/2106#issuecomment-2340020080
I add some debug log to veryfy if it has duplicated blockId.

And i got some logs:
```
[2024-09-09 23:51:03.422] [epollEventLoopGroup-3-29] [WARN] AbstractShuffleBuffer - append partitionId=8920 blockId=37413336496 is duplicated, prev block=ShufflePartitionedBlock{blockId[37413336496], length[11896], size[11928], uncompressLength[21560], crc[2412607028], taskAttemptId[144816]}
[2024-09-09 23:51:03.543] [Grpc-140] [ERROR] ShuffleServerGrpcService - Error happened when get shuffle result for appId[application_1703049085550_20299615_1725895467752], shuffleId[0], partitions[8920]
org.apache.uniffle.common.exception.RssException: Inconsistent block number for partitions: [8920]. Excepted: 43995, actual: 43996
at org.apache.uniffle.server.ShuffleTaskManager.getFinishedBlockIds(ShuffleTaskManager.java:656)
at org.apache.uniffle.server.ShuffleServerGrpcService.getShuffleResultForMultiPart(ShuffleServerGrpcService.java:939)
at org.apache.uniffle.proto.ShuffleServerGrpc$MethodHandlers.invoke(ShuffleServerGrpc.java:1056)
at io.grpc.stub.ServerCalls$UnaryServerCallHandler$UnaryServerCallListener.onHalfClose(ServerCalls.java:182)
at io.grpc.PartialForwardingServerCallListener.onHalfClose(PartialForwardingServerCallListener.java:35)
at io.grpc.ForwardingServerCallListener.onHalfClose(ForwardingServerCallListener.java:23)
at io.grpc.ForwardingServerCallListener$SimpleForwardingServerCallListener.onHalfClose(ForwardingServerCallListener.java:40)
at org.apache.uniffle.common.rpc.ClientContextServerInterceptor$1.onHalfClose(ClientContextServerInterceptor.java:63)
at io.grpc.PartialForwardingServerCallListener.onHalfClose(PartialForwardingServerCallListener.java:35)
at io.grpc.ForwardingServerCallListener.onHalfClose(ForwardingServerCallListener.java:23)
at io.grpc.internal.ServerCallImpl$ServerStreamListenerImpl.halfClosed(ServerCallImpl.java:356)
at io.grpc.internal.ServerImpl$JumpToApplicationThreadServerStreamListener$1HalfClosed.runInContext(ServerImpl.java:861)
at io.grpc.internal.ContextRunnable.run(ContextRunnable.java:37)
at io.grpc.internal.SerializingExecutor.run(SerializingExecutor.java:133)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:750)
```
From these logs, the cause might be that duplicate blockId is added to the same buffer in bufferPool, and the previously added block with the same blockId is replaced, resulting in an untraceable memory leal.
@zuston
--
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: issues-unsubscribe@uniffle.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@uniffle.apache.org
For additional commands, e-mail: issues-help@uniffle.apache.org
Re: [PR] fix[server] Fix duplicate blockId cause netty memory leak [incubator-uniffle]
Posted by "zuston (via GitHub)" <gi...@apache.org>.
zuston commented on PR #2106:
URL: https://github.com/apache/incubator-uniffle/pull/2106#issuecomment-2340371017
But I haven't found the `getNextSeqNo` will invoked by multi thread at the same time.
--
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: issues-unsubscribe@uniffle.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@uniffle.apache.org
For additional commands, e-mail: issues-help@uniffle.apache.org
Re: [PR] fix[server] Fix duplicate blockId cause netty memory leak [incubator-uniffle]
Posted by "zuston (via GitHub)" <gi...@apache.org>.
zuston commented on code in PR #2106:
URL: https://github.com/apache/incubator-uniffle/pull/2106#discussion_r1751724753
##########
client-spark/common/src/main/java/org/apache/spark/shuffle/writer/WriteBufferManager.java:
##########
@@ -413,10 +414,9 @@ protected ShuffleBlockInfo createShuffleBlock(int partitionId, WriterBuffer wb)
// it's run in single thread, and is not thread safe
Review Comment:
Let me revisit this part code
--
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: issues-unsubscribe@uniffle.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@uniffle.apache.org
For additional commands, e-mail: issues-help@uniffle.apache.org