Skip to content
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

AsyncTAPJob makes unnecessary network calls in property getter. #365

Open
andamian opened this issue Sep 21, 2022 · 3 comments
Open

AsyncTAPJob makes unnecessary network calls in property getter. #365

andamian opened this issue Sep 21, 2022 · 3 comments
Labels

Comments

@andamian
Copy link
Contributor

It looks like most of not all the mutable properties of the class AsynTAPJob make network calls to update the job info. Most of the time this seems an unnecessary overhead. At the very minimum, the code could be changed to avoid the _update calls if the job is in a final state, in which case the remote call is redundant.

@msdemlei
Copy link
Contributor

msdemlei commented Oct 11, 2022 via email

@gpdf
Copy link

gpdf commented Oct 11, 2022

The way that people work in the Rubin Science Platform will tend to produce quite a bit of contact between PyVO and jobs in the ARCHIVED state, so I would definitely not be happy with an approach that doesn't take that into account. (The use case is people looking at their query history, and deciding whether or not a - potentially very time-consuming - query needs to be re-run by whether the results are still available, i.e., exactly on COMPLETED vs. ARCHIVED.)

@andamian
Copy link
Contributor Author

The main point here is the frequency at which it fetches the data from the server. If the user creates an instance of AsyncTAPJob and tries to access its attributes, a separate GET call is generated every time an attribute is accessed.
If I'm not mistaken, the following code will produce 5 server calls. The info might not be consistent as the state of the job could change between calls.

job = AsyncTAPJob(url)
print('Job {job.job_id} own by {job.owner} runs query {job.query}, is in phase {job.phase} and estimated runtime {'job.quote'}

I don't think this is the intention of caller nor UWS which provides a snapshot of the job and returns all these attributes at once. Why can't the caller control when the state of a job is fetched from the server?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants