connector-x icon indicating copy to clipboard operation
connector-x copied to clipboard

PanicException: called `Result::unwrap()` on an `Err` value: Os { code: 35, kind: WouldBlock, message: "Resource temporarily unavailable" }

Open bitnlp opened this issue 2 years ago • 3 comments

What language are you using?

Python

What version are you using?

connectorx 0.3.1

What database are you using?

sqlite3

What dataframe are you using?

Pandas

Can you describe your bug?

The exception happens while selecting in a loop. After approx 1500 iterations. If time.sleep(0.01) is added right after the query then the problem goes away.

What are the steps to reproduce the behavior?

Database setup if the error only happens on specific data or data type

Table schema and example data

Example query / code

result_df = cx.read_sql("sqlite://" + xdb_path, "SELECT * FROM '" + table_name + "'")

What is the error?

thread '' panicked at 'called Result::unwrap() on an Err value: Os { code: 35, kind: WouldBlock, message: "Resource temporarily unavailable" }', /Users/runner/.cargo/registry/src/github.com-1ecc6299db9ec823/scheduled-thread-pool-0.2.6/src/lib.rs:320:44 note: run with RUST_BACKTRACE=1 environment variable to display a backtrace Exception in thread Thread-1: Traceback (most recent call last): File "/opt/homebrew/Caskroom/miniforge/base/envs/tf/lib/python3.9/threading.py", line 973, in _bootstrap_inner self.run() File "/opt/homebrew/Caskroom/miniforge/base/envs/tf/lib/python3.9/threading.py", line 910, in run self._target(*self._args, **self._kwargs) File "/Users/mac/tensorflow_macos_venv/monitor_cutoff.py", line 663, in get_dataframes ResultDFArray[mode_index], FactorArray[mode_index], MinDaysArray[mode_index] = get_combined_data(mode_in_list) File "/Users/mac/tensorflow_macos_venv/monitor_cutoff.py", line 382, in get_combined_data result_df = cx.read_sql("sqlite://" + xdb_path, "SELECT * FROM '" + table_name + "'") File "/opt/homebrew/Caskroom/miniforge/base/envs/tf/lib/python3.9/site-packages/connectorx/init.py", line 224, in read_sql result = _read_sql( pyo3_runtime.PanicException: called Result::unwrap() on an Err value: Os { code: 35, kind: WouldBlock, message: "Resource temporarily unavailable" }

bitnlp avatar Dec 09 '22 09:12 bitnlp

Hi I met the same problem, how do you solve it?

UESTCRoy avatar Mar 21 '23 04:03 UESTCRoy

We are also experiencing the same problem with reading from sqlite in a loop leading to

pyo3_runtime.PanicException: called `Result::unwrap()` on an `Err` value: Os { code: 11, kind: WouldBlock, message: "Resource temporarily unavailable" }

where errno 11 is EAGAIN 11 Resource temporarily unavailable

The error seems occur after a certain number of iterations, although the number of iterations is not the same on different machines, varying from 3000 on one to 60 on another before crashing.

We have a minimal reproducer if someone wants to dig into this

magnusuMET avatar May 11 '23 14:05 magnusuMET