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

Conversation

@mrocklin
Copy link
Member

commented Aug 22, 2019

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

This comment has been minimized.

Copy link
@jacobtomlinson

jacobtomlinson Aug 22, 2019

Member

This line made me smile 😄

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

This comment has been minimized.

Copy link
@rlratzel

rlratzel Aug 22, 2019

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.

This comment has been minimized.

Copy link
@mrocklin

mrocklin Aug 22, 2019

Author Member

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).

This comment has been minimized.

Copy link
@rlratzel

rlratzel Aug 22, 2019

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.

@jacobtomlinson
Copy link
Member

left a comment

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

@mrocklin mrocklin merged commit edc0943 into dask:master Aug 22, 2019

@mrocklin mrocklin deleted the mrocklin: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
Projects
None yet
3 participants
You can’t perform that action at this time.