LuciferYang opened a new pull request, #36484:
URL: https://github.com/apache/spark/pull/36484

   ### What changes were proposed in this pull request?
   There is lock contention between `LevelDBIterator.finalize()` and 
`LevelDB.close()` method. If `LevelDB.close()` method is executed first, the 
`LevelDBIterator`s hold by `Finalizer` will not close before the `LevelDB` 
close.
   
   This pr try to use a custom `ReferenceQueue + cleanupThread` instead of 
`Finalization` mechanism to automatically clean up `LevelDBIterator` resources 
that are not explicitly closed in Spark code.
   
   
   ### Why are the changes needed?
   Fix potential risk  `LevelDBIterator` resource leaks caused by lock 
contention.
   
   
   ### Does this PR introduce _any_ user-facing change?
   No
   
   
   ### How was this patch tested?
   - Pass GA and add a new test to check all LevelDBIterator not explicit closed


-- 
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]

Reply via email to