NVIDIA / NVIDIA/cudf

[BUG] Handle CudfException while instantiating ColumnViews

Open
#13,310 0 comments 0 reactions 0 assignees View on GitHub
0 - Backlog bug Java Spark
Dominant language
C++
Stars
9.8k
Forks
1.1k
Avg merge
3d 6m
Merged PRs (30d)
278

Description

**Describe the bug**
While instantiating ColumnViews in a loop. We could run into a case where somewhere in the middle of the instantiations we see a `CudfException`. Any attempt to call `close()` on successfully instantiated `ColumnView`s might throw another `CudfException`, causing us to be irrecoverable.

```
try {
columnViews[i] = new ColumnView();
} catch (Throwable e) {
for (ColumnView cv: columnViews) {
if (cv != null) cv.close(); // this could again throw
}
throw t;
}
```
Refer to https://github.com/rapidsai/cudf/pull/13262/files#diff-50ba2711690aca8e4f28d7b491373a4dd76443127c8b452a77b6c1fe2388d9e3R815-R828 for the exact example of this case.

**Expected behavior**
We should be able to recover ideally although, not sure if we can. Is this an irrecoverable state and can we just let the exception propagate upstream? Could we add the original exception as a suppressed exception in the new exception?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.