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

Make workers robust to bad custom metrics #2984

Merged
merged 2 commits into from Aug 22, 2019
Merged

Conversation

@mrocklin
Copy link
Member

@mrocklin mrocklin commented Aug 22, 2019

Fixes rapidsai/dask-cuda#122

@pytest.mark.asyncio
async def test_bad_metrics(cleanup):
def bad_metric(w):
raise Exception("Hello")
Copy link
Member

@jacobtomlinson jacobtomlinson Aug 22, 2019

Choose a reason for hiding this comment

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

This line made me smile 😄

Loading

if hasattr(result, "__await__"):
result = await result
custom[k] = result
except Exception:

Choose a reason for hiding this comment

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

Can we catch only the exception(s) raised in the situation where it's safe to ignore them? This catch-all handler will catch syntax errors and broken things that should work, making for a potential debugging mystery.

Loading

Copy link
Member Author

@mrocklin mrocklin Aug 22, 2019

Choose a reason for hiding this comment

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

Good point. Unfortunately the metrics provided here can be user provided, so we don't have a strong sense of what exactly we can catch and not catch.

Normally I would handle this by logging the error properly, so that we at least report up what's wrong while we don't error. However, this gets called frequently, and I would like to avoid dumping a ton of logging messages. This could be resolved by having some sort of log-once check or state, but at the moment I'm a bit pressed and didn't want to build this.

Suggestions welcome. Otherwise I'm going to merge and release shortly (there are a couple of other things that I'd like to get out there as well).

Loading

Choose a reason for hiding this comment

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

Okay, that's reasonable IMO. In lieu of your logging solution, maybe a FIXME describing that would be appropriate, possibly even with a link to your response here.

Loading

Copy link
Member

@jacobtomlinson jacobtomlinson left a comment

I can confirm this resolves rapidsai/dask-cuda#122 for me with local testing.

Loading

@mrocklin mrocklin merged commit edc0943 into dask:master Aug 22, 2019
@mrocklin mrocklin deleted the allow-bad-metrics branch Aug 22, 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
Linked issues

Successfully merging this pull request may close these issues.

3 participants