astro-datalab / datalab

Python client to interface with the NSF NOIRLab's Astro Data Lab Science Platform.
MIT License
22 stars 8 forks source link

queryClient async query with wait=True reports wrong elapsed time #21

Closed rnikutta closed 4 years ago

rnikutta commented 4 years ago

Example (with poll=2 seconds)

query = """SELECT ra,dec FROM smash_dr1.object 
WHERE fieldid = 169 AND depthflag > 1 
AND ndetr > 3 AND ndetg > 3 
AND abs(sharp) < 0.5 
AND gmag BETWEEN 9 AND 25 
AND (gmag-rmag) BETWEEN -0.4 AND 0.4"""

result = qc.query(adql=query,async_=True,wait=True,poll=2,verbose=1)

EXECUTING
Status = EXECUTING; elapsed time: 0, timeout in 300
EXECUTING
Status = EXECUTING; elapsed time: 4, timeout in 296
EXECUTING
Status = COMPLETED; elapsed time: 8, timeout in 292
Retrieving results

With poll=3 seconds:

result = qc.query(adql=query,async_=True,wait=True,poll=3,verbose=1)

EXECUTING
Status = EXECUTING; elapsed time: 0, timeout in 300
EXECUTING
Status = COMPLETED; elapsed time: 9, timeout in 291
EXECUTING
Status = COMPLETED; elapsed time: 18, timeout in 282
Retrieving results

It seems the elapsed time is not old+poll, but old+poll**2 (?)

rnikutta commented 4 years ago

Also, the first elapsed time reported is 0, not poll.

Example:

results = qc.query(adql=query,async_=True,wait=True,poll=15,verbose=1)

[and after 15 seconds...]

Status = EXECUTING; elapsed time: 0, timeout in 300
mjfitzpatrick commented 4 years ago

Fixed, changed checked into repo.

rnikutta commented 4 years ago

Which branch @mjfitzpatrick ? I can't find the commit.

mjfitzpatrick commented 4 years ago

It was a one-character change so checked directly into master. Commit: c88947e0e0c37d45d8ea2c09c8dfad6981d20a53

On Thu, Apr 30, 2020 at 3:31 PM Robert Nikutta notifications@github.com wrote:

Which branch @mjfitzpatrick https://github.com/mjfitzpatrick ? I can't find the commit.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/noaodatalab/datalab/issues/21#issuecomment-622151869, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABP7I64P47NSSEG6K3OAY7TRPH35PANCNFSM4MTHB6DQ .

rnikutta commented 4 years ago

ah, in queryManager repo! Could you please deploy it? (prod, and gp12).

mjfitzpatrick commented 4 years ago

Other commits for mydb and async are pending. I can do a hotfix so your notebooks look pretty but this is a pretty minor bug IMHO.

On Thu, Apr 30, 2020 at 3:50 PM Robert Nikutta notifications@github.com wrote:

ah, in queryManager repo! Could you please deploy to it? (prod, and gp12).

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/noaodatalab/datalab/issues/21#issuecomment-622159455, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABP7I6ZJZTHSVXLHXKXDX7LRPH6DHANCNFSM4MTHB6DQ .

rnikutta commented 4 years ago

We agree the bug is minor. But I'm currently running/producing NBs that are destined to end up in notebooks-latest, and it doesn't look good like this: :)

query = 'select count(*) from usno.b1'
results = qc.query(adql=query,async_=True,wait=True,poll=15,verbose=1)

EXECUTING
Status = EXECUTING; elapsed time: 0, timeout in 300
EXECUTING
Status = EXECUTING; elapsed time: 225, timeout in 75
EXECUTING
Status = EXECUTING; elapsed time: 450, timeout in -150
EXECUTING
Status = EXECUTING; elapsed time: 675, timeout in -375
EXECUTING
Status = EXECUTING; elapsed time: 900, timeout in -600
EXECUTING
Status = EXECUTING; elapsed time: 1125, timeout in -825
EXECUTING
Status = EXECUTING; elapsed time: 1350, timeout in -1050
EXECUTING
Status = EXECUTING; elapsed time: 1575, timeout in -1275
EXECUTING
Status = COMPLETED; elapsed time: 1800, timeout in -1500
Retrieving results

A hotfix would be appreciated in this one instance.

mjfitzpatrick commented 4 years ago

Hotfix installed on gp02 and gp12

On Thu, Apr 30, 2020 at 4:08 PM Robert Nikutta notifications@github.com wrote:

We agree the bug is minor. But I'm currently running/producing NBs that are destined to end up in notebooks-latest, and it doesn't look good like this: :)

query = 'select count(*) from usno.b1' results = qc.query(adql=query,async_=True,wait=True,poll=15,verbose=1)

EXECUTING Status = EXECUTING; elapsed time: 0, timeout in 300 EXECUTING Status = EXECUTING; elapsed time: 225, timeout in 75 EXECUTING Status = EXECUTING; elapsed time: 450, timeout in -150 EXECUTING Status = EXECUTING; elapsed time: 675, timeout in -375 EXECUTING Status = EXECUTING; elapsed time: 900, timeout in -600 EXECUTING Status = EXECUTING; elapsed time: 1125, timeout in -825 EXECUTING Status = EXECUTING; elapsed time: 1350, timeout in -1050 EXECUTING Status = EXECUTING; elapsed time: 1575, timeout in -1275 EXECUTING Status = COMPLETED; elapsed time: 1800, timeout in -1500 Retrieving results

A hotfix would be appreciated in this one instance.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/noaodatalab/datalab/issues/21#issuecomment-622165872, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABP7I66ECFENNT6LBVINGFDRPIAF5ANCNFSM4MTHB6DQ .