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

Raise exceptions from environment subprocesses #3680

Merged
merged 6 commits into from
Mar 26, 2020

Conversation

harperj
Copy link
Contributor

@harperj harperj commented Mar 24, 2020

Proposed change(s)

This commit surfaces exceptions from environment worker subprocesses,
and changes the SubprocessEnvManager to raise those exceptions when
caught. Additionally TrainerController was changed to treat environment
exceptions differently than KeyboardInterrupts. We now raise the
environment exceptions after exporting the model, so that ML-Agents will
correctly exit with a non-zero return code.

Useful links (Github issues, JIRA tickets, ML-Agents forum threads etc.)

Types of change(s)

  • Bug fix
  • New feature
  • Code refactor
  • Breaking change
  • Documentation update
  • Other (please describe)

Checklist

  • Added tests that prove my fix is effective or that my feature works
  • Updated the changelog (if applicable)
  • Updated the documentation (if applicable)
  • Updated the migration guide (if applicable)

Other comments

@harperj harperj requested review from ervteng and chriselion March 24, 2020 21:41
@ervteng
Copy link
Contributor

ervteng commented Mar 24, 2020

Looks good to me - should we add a test that makes sure the exception is passed correctly up?

@harperj
Copy link
Contributor Author

harperj commented Mar 24, 2020

@ervteng Good timing :-)

Just pushed a test showing we raise the exception from SubprocessEnvManager.

Jonathan Harper added 3 commits March 24, 2020 22:04
This commit surfaces exceptions from environment worker subprocesses,
and changes the SubprocessEnvManager to raise those exceptions when
caught.  Additionally TrainerController was changed to treat environment
exceptions differently than KeyboardInterrupts.  We now raise the
environment exceptions after exporting the model, so that ML-Agents will
correctly exit with a non-zero return code.
@harperj harperj force-pushed the develop-raise-env-errors branch from cda8843 to aa39e45 Compare March 25, 2020 05:08
@harperj harperj force-pushed the develop-raise-env-errors branch from aa39e45 to 0155a69 Compare March 25, 2020 05:11
Copy link
Contributor

@ervteng ervteng left a comment

Choose a reason for hiding this comment

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

LGTM!

@harperj harperj merged commit 25ddb70 into master Mar 26, 2020
@delete-merged-branch delete-merged-branch bot deleted the develop-raise-env-errors branch March 26, 2020 21:20
@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 15, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants