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

DirectScheduler: Add ? as JobState.UNDETERMINED #6040

Merged
merged 1 commit into from
May 29, 2023

Conversation

mbercx
Copy link
Member

@mbercx mbercx commented May 27, 2023

Fixes #3107

When running a process via engine.run on a MacOS localhost using the core.direct scheduler, warning are often raised regarding an "unrecognised job state ?'. This is related to the fact that on MacOS the ps command is sometimes not able to determine the process state temporarily, and print a ? in the STAT column.

Here we simply add the ? as one of the possible outputs of the ps commmand in the _MAP_STATUS_PS dictionary, mapping it to JobState.UNDETERMINED.

@mbercx mbercx requested a review from sphuber May 27, 2023 21:47
@mbercx
Copy link
Member Author

mbercx commented May 27, 2023

@sphuber I was running into this problem quite regularly. I looked into it, and it seems that on MacOS the ps command can sometimes return ? for the process state since it's unable to determine the state properly. This one line of code fixes the issue, and it seem appropriate to map this state to UNDETERMINED.

When running a process via `engine.run` on a MacOS `localhost` using the
`core.direct` scheduler, warnings are often raised regarding an
"unrecognised job state `?`'. This is related to the fact that on MacOS the `ps`
command is sometimes not able to determine the process state temporarily, and
prints a `?` in the `STAT` column, see:

https://apple.stackexchange.com/q/460394/497071

Here we simply add the `?` as one of the possible outputs of the `ps` commmand
in the `_MAP_STATUS_PS` dictionary, mapping it to `JobState.UNDETERMINED`.
@mbercx mbercx force-pushed the fix/3107/unrecognised-job branch from c0537e6 to 151af2d Compare May 28, 2023 19:03
@mbercx mbercx requested a review from sphuber May 28, 2023 19:03
Copy link
Contributor

@sphuber sphuber left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @mbercx

@sphuber sphuber merged commit ffc869d into aiidateam:main May 29, 2023
@mbercx mbercx deleted the fix/3107/unrecognised-job branch May 29, 2023 20:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Fix Unrecognized job_state '?' warning
2 participants