Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -68,12 +68,9 @@ protected BufferAllocator rootAllocator() {

protected List<ArrowRecordBatch> collectResultFromFactory(
DatasetFactory factory, ScanOptions options) {
final Dataset dataset = factory.finish();
final Scanner scanner = dataset.newScan(options);
try {
final List<ArrowRecordBatch> ret = collectTaskData(scanner);
AutoCloseables.close(scanner, dataset);
return ret;
try (Dataset dataset = factory.finish();
Scanner scanner = dataset.newScan(options)) {
return collectTaskData(scanner);
} catch (RuntimeException e) {
throw e;
} catch (Exception e) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,9 +122,9 @@ public void unreserve(long size) {
},
errorMessage);
long reservation = reserved.get();
AutoCloseables.close(pool);
long finalReservation = reserved.get();
assertEquals(initReservation, reservation);
assertEquals(initReservation, finalReservation);
// The failed scan can leave work running on Arrow C++ threads that still uses the pool,
// and closing the scanner doesn't wait for it. Closing the pool here would free it under
// that work and crash the JVM, so the pool is left open (GH-1455).
}
}
Loading