You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Bug: Database() with max_num_threads=0 hangs every query since 0.23.0 #82
This work was produced with the help of language models.
On 0.23.0, a Database opened with max_num_threads=0 never returns from its first statement, not even RETURN 1:
importladybugaslbdb=lb.Database(":memory:", max_num_threads=0)
conn=lb.Connection(db)
conn.execute("RETURN 1") # never returns
buffer_pool_size=0 fails at open instead:
RuntimeError: Buffer manager exception: The given buffer pool size should be at least 4096 bytes.
Expected: 0 uses the engine default, as on 0.22.3, where 0 was the default value of both parameters: one thread per logical CPU, and about 80% of memory for the buffer pool.
Actual: the hung process has a single thread, because the engine started no query workers.
Reproduces on 0.23.0 with the pybind backend. That is the backend the wheels run, since they don't bundle the C API library. 0.22.3 is clean. max_num_threads=1, max_num_threads=4 and leaving it unset all work on 0.23.0.
Cause. Since #77, PyDatabase starts from SystemConfig() and then assigns each value that is set. Only the SystemConfig constructor turns 0 into the default for bufferPoolSize and maxNumThreads, so a 0 assigned afterwards stays 0. The C-API backend is not affected, because lbug_database_init passes the values through the constructor.
Activity