Skip to content

common.getSeconds does not handle empty argument #21

@bhmevik

Description

@bhmevik

With Slurm, the UserCPU output of sacct can be empty, for instance if a job got cancelled while it was pending. In such cases, common.getSeconds() will log an error and return -1.
Perhaps a better action is to silently return 0.
If that is not acceptable, then a test for this case should be added in createUsageRecord() in slurm.py, so it circumvents getSeconds() if the value is empty (or calls getSeconds() with '00:00').
If one wants to be more secure, one could do this only when Start and End times are the same (or Elapsed is '00:00:00'), and allow getSeconds() to log an error otherwise.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions