anothersmith / node-duckdb

DuckDB NodeJS bindings
MIT License
48 stars 12 forks source link

Node process should not exit if DuckDB throws exception on C++ side #81

Closed dforsber closed 3 years ago

dforsber commented 3 years ago

Steps to reproduce, two node-duckb instances on NodeJS side. One opens a DuckDB database in AccessMode.ReadWrite and the other one AccessMode.ReadOnly concurrently. One of them throws.

  terminate called after throwing an instance of 'duckdb::IOException'
   what():  IO Error: Could not set lock on file "test.db": Resource temporarily unavailable

The same thing happens with the DuckDB client:

# shell 1
% duckdb test.duckdb
v0.2.4 d1b02c270
Enter ".help" for usage hints.
D CREATE TABLE t(t INTEGER);
D 
# shell 2
% duckdb -readonly test.duckdb
Error: unable to open database "test.duckdb": 
rprovodenko commented 3 years ago

resolved