uniffle: [Bug] Occasionally encountering IllegalReferenceCountException when releasing ShuffleIndexResult
Code of Conduct
- I agree to follow this project’s Code of Conduct
Search before asking
- I have searched in the issues and found no similar issues.
Describe the bug
https://github.com/apache/incubator-uniffle/actions/runs/9282054580/job/25539265104?pr=1752
org.apache.uniffle.test.RepartitionWithHadoopHybridStorageRssTest
Error stacktrace:
Caused by: org.apache.uniffle.common.exception.RssFetchFailedException: Failed to read shuffle data from HOT handler
at org.apache.uniffle.storage.handler.impl.ComposedClientReadHandler.readShuffleData(ComposedClientReadHandler.java:124)
at org.apache.uniffle.client.impl.ShuffleReadClientImpl.read(ShuffleReadClientImpl.java:305)
at org.apache.uniffle.client.impl.ShuffleReadClientImpl.readShuffleBlockData(ShuffleReadClientImpl.java:213)
at org.apache.spark.shuffle.reader.RssShuffleDataIterator.hasNext(RssShuffleDataIterator.java:115)
at org.apache.spark.util.CompletionIterator.hasNext(CompletionIterator.scala:31)
at org.apache.spark.shuffle.reader.RssShuffleReader$MultiPartitionIterator.hasNext(RssShuffleReader.java:307)
at org.apache.spark.util.collection.ExternalAppendOnlyMap.insertAll(ExternalAppendOnlyMap.scala:155)
at org.apache.spark.Aggregator.combineCombinersByKey(Aggregator.scala:50)
at org.apache.spark.shuffle.reader.RssShuffleReader.read(RssShuffleReader.java:136)
at org.apache.spark.rdd.ShuffledRDD.compute(ShuffledRDD.scala:106)
at org.apache.spark.rdd.RDD.computeOrReadCheckpoint(RDD.scala:365)
at org.apache.spark.rdd.RDD.iterator(RDD.scala:329)
at org.apache.spark.shuffle.ShuffleWriteProcessor.write(ShuffleWriteProcessor.scala:59)
at org.apache.spark.scheduler.ShuffleMapTask.runTask(ShuffleMapTask.scala:99)
at org.apache.spark.scheduler.ShuffleMapTask.runTask(ShuffleMapTask.scala:52)
at org.apache.spark.scheduler.Task.run(Task.scala:136)
at org.apache.spark.executor.Executor$TaskRunner.$anonfun$run$3(Executor.scala:548)
at org.apache.spark.util.Utils$.tryWithSafeFinally(Utils.scala:1504)
at org.apache.spark.executor.Executor$TaskRunner.run(Executor.scala:551)
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)
Caused by: io.netty.util.IllegalReferenceCountException: refCnt: 0, decrement: 1
at io.netty.util.internal.ReferenceCountUpdater.toLiveRealRefCnt(ReferenceCountUpdater.java:83)
at io.netty.util.internal.ReferenceCountUpdater.release(ReferenceCountUpdater.java:148)
at io.netty.buffer.AbstractReferenceCountedByteBuf.release(AbstractReferenceCountedByteBuf.java:101)
at org.apache.uniffle.common.netty.buffer.NettyManagedBuffer.release(NettyManagedBuffer.java:59)
at org.apache.uniffle.common.ShuffleIndexResult.release(ShuffleIndexResult.java:75)
at org.apache.uniffle.storage.handler.impl.DataSkippableReadHandler.readShuffleData(DataSkippableReadHandler.java:82)
at org.apache.uniffle.storage.handler.impl.ComposedClientReadHandler.readShuffleData(ComposedClientReadHandler.java:113)
... 21 more
Reason: Unknown Priority: Minor
Affects Version(s)
master
Uniffle Server Log Output
No response
Uniffle Engine Log Output
No response
Uniffle Server Configurations
No response
Uniffle Engine Configurations
No response
Additional context
No response
Are you willing to submit PR?
- Yes I am willing to submit a PR!
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Comments: 16 (16 by maintainers)
Commits related to this issue
- [#1628] Avoid exception caused by calling release multiple times — committed to wForget/incubator-uniffle by wForget 2 years ago
- [#1628] test(client): Fix double release ShuffleIndexResult cause exception to pass flaky test (#2179) ### What changes were proposed in this pull request? (Please outline the changes and how thi... — committed to maobaolong/incubator-uniffle by maobaolong 2 years ago
- [#1628] test(client): Fix double release ShuffleIndexResult cause exception to pass flaky test (#2179) ### What changes were proposed in this pull request? (Please outline the changes and how this ... — committed to maobaolong/incubator-uniffle by maobaolong 2 years ago
I think it is feasible, you can do it. Although setting the internal buffer to null might have a positive impact on GC, this impact is usually minimal.
I think they are different. This is caused by calling
ShuffleIndexResult.release. https://github.com/apache/incubator-uniffle/issues/1818 is caused by callingShuffleDataResult.release.