Skip to content

Conversation

@SteNicholas
Copy link
Member

What changes were proposed in this pull request?

Should close the RocksDB/LevelDB instance when checkVersion throw Exception.

Backport [SPARK-46389][CORE] Manually close the RocksDB/LevelDB instance when checkVersion throw Exception.

Why are the changes needed?

In the process of initializing the DB in RocksDBProvider/LevelDBProvider, there is a checkVersion step that may throw an exception. After the exception is thrown, the upper-level caller cannot hold the already opened RockDB/LevelDB instance, so it cannot perform resource cleanup, which poses a potential risk of handle leakage. So this PR manually closes the RocksDB/LevelDB instance when checkVersion throws an exception.

Does this PR introduce any user-facing change?

No.

How was this patch tested?

CI.

Copy link
Contributor

@cxzl25 cxzl25 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Contributor

@FMX FMX left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Merged into main(v0.5.0).

@codecov
Copy link

codecov bot commented Mar 8, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 48.84%. Comparing base (0f60dce) to head (0ff1b3c).
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2369      +/-   ##
==========================================
- Coverage   48.85%   48.84%   -0.00%     
==========================================
  Files         208      208              
  Lines       12984    12984              
  Branches     1115     1115              
==========================================
- Hits         6342     6341       -1     
  Misses       6232     6232              
- Partials      410      411       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@FMX FMX closed this in 19b78de Mar 8, 2024
SteNicholas added a commit that referenced this pull request Apr 23, 2024
…kVersion throw Exception

### What changes were proposed in this pull request?

Should close the `RocksDB`/`LevelDB` instance when `checkVersion` throw Exception.

Backport [[SPARK-46389][CORE] Manually close the RocksDB/LevelDB instance when checkVersion throw Exception](apache/spark#44327).

### Why are the changes needed?

In the process of initializing the DB in `RocksDBProvider`/`LevelDBProvider`, there is a `checkVersion` step that may throw an exception. After the exception is thrown, the upper-level caller cannot hold the already opened RockDB/LevelDB instance, so it cannot perform resource cleanup, which poses a potential risk of handle leakage. So this PR manually closes the `RocksDB`/`LevelDB` instance when `checkVersion` throws an exception.

### Does this PR introduce _any_ user-facing change?

No.

### How was this patch tested?

CI.

Closes #2369 from SteNicholas/CELEBORN-1315.

Authored-by: SteNicholas <[email protected]>
Signed-off-by: mingji <[email protected]>
SteNicholas added a commit that referenced this pull request Apr 23, 2024
…kVersion throw Exception

### What changes were proposed in this pull request?

Should close the `RocksDB`/`LevelDB` instance when `checkVersion` throw Exception.

Backport [[SPARK-46389][CORE] Manually close the RocksDB/LevelDB instance when checkVersion throw Exception](apache/spark#44327).

### Why are the changes needed?

In the process of initializing the DB in `RocksDBProvider`/`LevelDBProvider`, there is a `checkVersion` step that may throw an exception. After the exception is thrown, the upper-level caller cannot hold the already opened RockDB/LevelDB instance, so it cannot perform resource cleanup, which poses a potential risk of handle leakage. So this PR manually closes the `RocksDB`/`LevelDB` instance when `checkVersion` throws an exception.

### Does this PR introduce _any_ user-facing change?

No.

### How was this patch tested?

CI.

Closes #2369 from SteNicholas/CELEBORN-1315.

Authored-by: SteNicholas <[email protected]>
Signed-off-by: mingji <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants