`arango.exceptions.AsyncJobResultError` : job 1530399 not done
aaqibb13 opened this issue · 7 comments
- I'm executing AQL queries by creating the AsyncDatabase instance of database from
arango.database.StandardDatabase.begin_async_executionand even after executing simple insert queries, it returnsAsyncJobResultErrortoo often.
The query simply looks like:
# db is the AsyncDatabase instance of the database
result = db.insert_document(
collection="test",
document=doc_in_db,
return_new=return_new,
sync=sync
)
result = wait_for_results(result)
return result- I used the
wait_for_resultsfunction to wait for the job to finish, but it didn't help either: Thewait_for_resultslooks like this:
def wait_for_results(job):
while job.status() != 'done':
time.sleep(0.5)
time.sleep(0.5)
return job.result()It returns:
-
arango.exceptions.AsyncJobResultError: job 1530399 not done -
Someone else happen to come across the same problem a year and a half before, but looks like nothing to solve the issue:
https://stackoverflow.com/questions/66964626/why-simple-aql-execute-returns-asyncjobresulterror-when-client-requests-data
Any pointers on how the problem can be fixed?
@aaqibb13, I am trying to reproduce the issue, without any luck so far. Here is the code that I am using:
import time
from arango import (
ArangoClient,
AQLQueryExecuteError,
AsyncJobCancelError,
AsyncJobClearError
)
client = ArangoClient(hosts="http://localhost:8529")
sdb = client.db('<dbName>', username='<userName>', password='<password>')
adb = sdb.begin_async_execution(return_result=True)
job = adb.collection('<collection_name>').insert(
document={'name': 'James'},
return_new=True,
sync=True)
while job.status() != 'done':
time.sleep(0.5)
result = job.result()This code works fine. The value of result on the last line is:
{'_id': 'persons/390575', '_key': '390575', '_rev': '_fA5Mlxq---', 'new': {'_key': '390575', '_id': 'persons/390575', '_rev': '_fA5Mlxq---', 'name': 'James'}}
The name of my collection is persons.
I am using the latest version of the driver (7.5.2) with ArangoDB 3.10. Can you try the above code on your side and confirm whether it works please?
Also, confirm the version of the driver and ArangoDB server that you are using.
Hey @tjoubert , thanks for you response. I was using an earlier version of the driver (7.5.1). After I upgraded to the version you specified, my code worked just fine!
Also, I'm using the ArangoDB server version 3.9.3.
Can you kindly confirm whether the issue actually exists with python-arango version 7.5.1?
Hi @aaqibb13, that's very good news that your code is now working.
FYI, I tested the same code with python-arango 7.5.1 and ArangoDB 3.9.3 and it works.
Thanks for reporting the issue.
Hey @tjoubert, I have a CI/CD pipeline for the project that I'm working on. I tried to reproduce the issue locally but to no avail (The same queries works just fine locally). However, when I hit the endpoint where the queries is being run, the problem arises.
The logs I shared (arango.exceptions.AsyncJobResultError : job 1530399 not done) were from my remote (my deployment)
Is there something I'm missing? I'm curious!