Ticket #267 (closed defect: fixed)

Opened 3 years ago

Last modified 3 years ago

No limit on job rest call

Reported by: robert Owned by: robert
Priority: minor Milestone: MediaMosa 2.2
Component: Core Version:
Keywords: Cc:
MoSCoW: Must Have Estimated time after impact analysis:
Related to project: none Tested: yes
Accepted: yes Estimated Hours: 8

Description

On the REST call /asset/$asset_id/joblist is no limit on items that it return. In most cases this will not be a problem. But it can happen that assets will build up a lot of old jobs which might cause problems on the output this REST call can generate (memory, long time the REST call will return output etc).

Scope: 1.x and up.

Change History

Changed 3 years ago by Frans

  • milestone changed from MediaMosa X.X to MediaMosa 2.2

Not only a numerical limit, but also on job status in order to filter not completed or running jobs.
SURFmedia asks for /asset/{id}/joblist on every item.html, and it is looking for not-finished trancodings or transcodings in progress. Finished transcodings and finished analysis could be omitted by e.g. /joblist?hide_finished=true or /joblist?running=true or so.

Changed 3 years ago by Frans

  • moscow changed from Should Have to Must Have

Changed 3 years ago by robert

  • estimated_hours set to 8

Changed 3 years ago by MC-arjen

  • owner set to forgacs
  • status changed from new to assigned

Changed 3 years ago by robert

  • owner changed from forgacs to frans

Frans,

Is it ok to use CQL here? I have this terrible feeling that if we will be using old-fashion syntax like created=date|date and status[]=INPROGRESS or status_not[]=INPROGRESS we will be adding so many new parameters and options to this rest call, while using CQL it should be a lot easier and lot more flexible. Ill provide for a extended manual on this rest call how to search on each parameter with CQL.

So ok to implement with CQL parameter or with normal parameters per field/option?

Changed 3 years ago by Frans

Robert, Using CQL here is good and flexible. So go ahead!
The extended CQL manual is also welcome, so go ahead with this too ;-)

Changed 3 years ago by robert

  • status changed from assigned to closed
  • resolution set to fixed

Changed 3 years ago by Michiel.Schok

  • status changed from closed to reopened
  • tested changed from no to yes
  • resolution fixed deleted

A Bug and an Question:

Bug: when limit is set below the total amount of jobs, 'item_count_total' doesn't reflect the total, but is equal to 'item_count'.

We have an asset with three (3) jobs:

  <header>
    <item_count>3</item_count>
    <item_count_total>3</item_count_total>
    <item_offset>0</item_offset>
...
    <request_uri>[GET] asset/Pf1HVZWuKUPFZh9zKqit8DDe/joblist?user_id=SURFguest.Rijnmond</request_uri>
    <version>2.2.0.727:2453fceb2426</version>
    <request_query_count>2</request_query_count>
  </header>

When we only request 2 of them (we want to introduce pagination ;-) )

  <header>
    <item_count>2</item_count>
    <item_count_total>2</item_count_total>
    <item_offset>0</item_offset>
...
    <request_uri>[GET] asset/Pf1HVZWuKUPFZh9zKqit8DDe/joblist?user_id=SURFguest.Rijnmond&amp;limit=2</request_uri>
...
  </header>

Question: /admin/mediamosa/browse/restcall/asset-%24asset_id-joblist/GET
shows some CQL examples. Are there any other fields that can be used? The last two examples: do they parse <error_description>?

Changed 3 years ago by forgacs

  • owner changed from frans to robert
  • status changed from reopened to assigned

Fixed: item_count_total.

Fields that can be used:

job_id
app_id
mediafile_id
owner_id
status
progress
priority
job_type
started
finished
create_still
no_hint
still_parameters
error_description
created
changed

"create_still" and "no_hint": The response "error_description" is the "error_description" field of the job without any modification.

Robert: Please, review the changes.

Changed 3 years ago by robert

  • status changed from assigned to closed
  • resolution set to fixed

Changed 3 years ago by Michiel.Schok

  • accepted changed from no to yes

Curious:
when I issue a

[GET] asset/P2WQuIonDsIuTdePEbmNdmKV/joblist?user_id=SURFgroepen.michiel71

I dont get a message saying "you are not allowed to view the joblist" but rather a

    <request_result>success</request_result>
    <request_result_description>The query returned an empty result set (i.e. zero rows).</request_result_description>

The same request using the owner_id of the asset as user_id returns the joblist.

But the rest is working as advertised.
Checked using limit=5, limit=5&offset=10, cql=(status==finished), cql=(job_type=analyse)

Changed 3 years ago by robert

About your "you are not allowed to view the joblist";

Hmm hmm. That is some curious question. Do you need to be owner of the asset to see the jobs? You don't need to be owner of the asset to see the asset in normal asset call. Think you need to compare the search on the joblist as the search on assets. If no assets where found (because of access) then you still retrieve a empty result message.

I do see that when supplying the is_app_admin = TRUE parameter you can retrieve any job(s) of any asset of any app. Looking at the code in 1.7 also, its been designed like this. Maybe need some work as well?

Changed 3 years ago by robert

See #356 and #357

Note: See TracTickets for help on using tickets.