'Create a Job' for longer calculations running forever without returning results

Which tool versions are you using?

SDK: v14.13.0
Platform: v24.x.x
Python: v3.11
Isolation mode: venv

Current Behavior

When using the REST API to ‘Create a Job’ and polling for the results, it appears as running indefinitely and never returns results for jobs that take some seconds (in my case around 5s).
I have done some tests changing only the calculation time and this behaviour seems to start appearing when the calculation takes more than around 1.2 seconds.

Expected Behavior

It should return the results once the calculation is finished.

Hi fzhou,

Could you elaborate a bit more on how you are trying to use the REST API?

There are usually two parts of the flow:

  1. You create and start the job following: Create a Job | VIKTOR Documentation
    • make sure to set poll_result=False
    • you should get a status 201, with the response that includes a url to the job-resource
  2. Using the url, you poll the job status and potentially get a result following: Get Job by Id | VIKTOR Documentation

Note, if you would set poll_result=true in the first step, this might lead to a successful result (with status=200) within the first second, but if the job does not complete within 1 second, you will receive the job-resource url and should continue to step 2.

Thanks kvangiessen for the clarification! This solved my issue