aneoconsulting / ArmoniK.Core

Task manager for ArmoniK (submission, scheduling, IO data, monitoring). Implements API located in https://github.com/aneoconsulting/ArmoniK.Api
https://aneoconsulting.github.io/ArmoniK.Core/
GNU Affero General Public License v3.0
10 stars 8 forks source link

TaskOptions "max_retry" and "priority" can't be filtered correctly. #516

Closed fdewas-aneo closed 10 months ago

fdewas-aneo commented 1 year ago

Working on the Admin GUI, I found an unexpected behaviour when filtering some TaskOption properties: max-retry and priority.

They are the only numerical properties of the TaskOption. To explain it shortly, only the filters operations Equal (value: 0) and Not Equal (value: 1) are providing a result.

Core version : v0.17.0

I'm running armonik with the "all-in-one" deployment and used "unified api" as a sample.

I've send this data to the TaskClient (you can replace the operator: 2 by 3, 4, or 5 to have the behaviour):

{
    "page": 0,
    "pageSize": 5,
    "filters": {
        "or": [
            {
                "and": [
                    {
                        "field": {
                            "taskOptionField": {
                                "field": 2
                            }
                        },
                        "filterStatus": {
                            "value":4,
                            "operator": 2
                        }
                    }
                ]
            }
        ]
    },
    "sort": {
        "field": {
            "taskSummaryField": {
                "field": 16
            }
        },
        "direction": 1
    },
    "withErrors": false
}

Expected result: a list of Tasks

[{"id":..., ...}, {"id":..., ...}, {"id":..., ...}, ...]

Received (my SEQ doesn't have anything):

{
    "statusCode": 2,
    "statusMessage": "Unknown Exception, see application logs",
    "metadata": {
        "map": {}
    }
}

Ideas:

fdewas-aneo commented 10 months ago

I wasn't using the correct object. Max retry and priority are both options, and i was filtering them with a non-optionnal number field