-
Notifications
You must be signed in to change notification settings - Fork 58
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Async select not returning all rows #331
Comments
I haven't seen this behavior myself, but I also don't see anything obviously wrong with your code. Can you supply a full test case? It is possible that the data being fetched is important in some fashion. Ideally you have a create table statement and a PL/SQL block (or Python script) that populates the table with the data. Then the script posted above can be run to demonstrate the issue. As an aside, why are you using the release candidate for Python 3.11? :-) |
I will work on seeing if I can recreate the issue in a database I have more permissions on, with data that is generated and shareable. Your question re: Python 3.11 prompted me to go back and check. At some point in the past as I was trying to figure this out I was just trying the different versions of python available in my package manager to see if that had any impact. I guess I just ended up on 3.11 and my version of Ubuntu has a release candidate as the current python 3.11 version:
Anyway, I will hopefully get back to you relatively soon. Thank you for all of your work on this! |
I have this test case which for me is working. I have dropped and recreated the table several times and each time it has successfully brought forth the error, however since the data load is using random data I do not know that I can guarantee it will always work. I also do not know what part of the test case is actually important - I took one of the tables that was causing issues and used its basic schema, loading it with random data.
Data Load:
This is some example output I got: I had also tried originally with loading 10million records. This takes a very long time though (at least on my server): Anyway, I really hope you are able to reproduce. |
I just tried your script with Python 3.12 and did not notice any difficulties and I ran it multiple times. Asyncio is still relatively new and there have been issues reported. Can you try with Python 3.12 and the newly released python-oracledb 2.2.0 and see if you are still able to reproduce in your setup? I also used the recently released Oracle Database 23ai but that shouldn't have any bearing on this issue! Is the database local? Or is there significant latency between the client and the database? |
I just tried with Python 3.12 and the latest oracledb 2.2.0 and I'm still getting the same issue. I'm running on a virtualbox guest & the database is not local. I have not noticed any particularly noticeable latency before between the database, but I have never actually tried and measured such a thing either. It is both geographically and network-topographically quite close. I do a lot of oracle development (SQL & PL/SQL), but I am not really much of an administrator - are there any database parameters that could possibly be of interest here? I will try a few more things and see if I can figure out anything else. If I can figure out anything I will update here. Thank you again for all of your efforts on this! |
Oracle DB 19.22.0.0.0
platform.platform: Linux-6.5.0-28-generic-x86_64-with-glibc2.35
sys.maxsize > 2**32: True
platform.python_version: 3.11.0rc1
oracledb.version: 2.1.2
Is it an error or a hang or a crash?
An error.
What error(s) or behavior you are seeing?
When using async mode, fetches seem to end early. The issue seems to occur on every execution, though the exact number of rows returned is inconsistent. It works properly when using synchronous mode. I am relatively new to python, but believe the basic test code is correct - would be happy if this is just a problem of me doing something dumb. I am connecting to a database I have no control over.
Here is my script call and output:
python simple_test.py
Password:
async starting...
async connection acquired...
async cursor created...
async getting count(1)...
async getting rows...
async Elapsed Time: 35.00 seconds
async COUNT(1): 9375506
async total_fetched_rows: 32802
async cursor.rowcount: 32802
No.
The text was updated successfully, but these errors were encountered: