Skip to content

Unclosed Quotation Mark (") in CSV May Lead to Potential Deadlock #251

@WeiTanZzz

Description

@WeiTanZzz

Description
Hi!

I have a malformed file, which contain one unclosed quotation. It will lead a dead lock when concurrent = false.

When concurrent = true it will throw below error nicely.

Caused by: java.util.concurrent.ExecutionException: io.deephaven.csv.util.CsvReaderException: While processing row 2, column "Location":

Steps to reproduce

import io.deephaven.csv.CsvSpecs;
import io.deephaven.csv.reading.CsvReader;
import io.deephaven.csv.sinks.SinkFactory;

import java.io.FileInputStream;
import java.io.InputStream;

public class Tmp {
    public static void main(String[] args) throws Exception {
        //print java version
        System.out.println("Java version: " + System.getProperty("java.version"));

        final InputStream inputStream = new FileInputStream("./file_malformed.csv");
        final CsvSpecs specs = CsvSpecs.builder().delimiter(',').allowMissingColumns(true).concurrent(false).build();
        final CsvReader.Result result = CsvReader.read(specs, inputStream, SinkFactory.arrays());
        final long numRows = result.numRows();

        //no result, main thread gets blocked all the time.
        System.out.println("Number of rows: " + numRows);
    }
}

Expected results
Throw an error

Versions
Java Version: corretto-21.0.3
OS: macOS Sequoia 15.5 (24F74)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions