Skip to content

Handle StopIteration in CloudWatch Logs retrieval during training #594

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

Merged
merged 5 commits into from
Jan 16, 2019

Conversation

yangaws
Copy link
Contributor

@yangaws yangaws commented Jan 10, 2019

Issue #, if available:

Description of changes:
In current codes, StopIteration exception was not handled when retrieving CloudWatch Log streams during training. That's why there's related warnings 'DeprecationWarning: generator 'multi_stream_iter' raised StopIteration' can be seen in logs. And in py3.7, this will be an error instead of a warning, see:

PEP 479 is enabled for all code in Python 3.7, meaning that StopIteration exceptions raised directly or indirectly in coroutines and generators are transformed into RuntimeError exceptions. (Contributed by Yury Selivanov in bpo-32670.)

This PR handles the exception by swallowing it.

Merge Checklist

Put an x in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your pull request.

  • I have read the CONTRIBUTING doc
  • I have added tests that prove my fix is effective or that my feature works (if appropriate)
  • I have updated the changelog with a description of my changes (if appropriate)
  • I have updated any necessary documentation (if appropriate)

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@codecov-io
Copy link

codecov-io commented Jan 10, 2019

Codecov Report

Merging #594 into master will decrease coverage by 0.06%.
The diff coverage is 55.55%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #594      +/-   ##
==========================================
- Coverage   92.75%   92.69%   -0.07%     
==========================================
  Files          71       71              
  Lines        5397     5405       +8     
==========================================
+ Hits         5006     5010       +4     
- Misses        391      395       +4
Impacted Files Coverage Δ
src/sagemaker/logs.py 89.06% <55.55%> (-5.59%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update bae98db...6fa11eb. Read the comment docs.

iquintero
iquintero previously approved these changes Jan 10, 2019
iquintero
iquintero previously approved these changes Jan 11, 2019
@yangaws yangaws merged commit f341864 into aws:master Jan 16, 2019
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.

4 participants