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

Add HTML reprs for Client.who_has and Client.has_what #4853

Merged

Conversation

jacobtomlinson
Copy link
Member

@jacobtomlinson jacobtomlinson commented May 26, 2021

@quasiben mentioned folks are regularly asking about how to better understand what workers have what keys.

Threw together some quick HTML reprs for Client.who_has and Client.has_what to try and make things more understandable.

I followed the same approach as distributed.utils.Logs by subclassing a dict and adding an HTML repr to it. I wasn't sure if distributed.utils was the right place for this though, so I started distributed.objects for a place to put custom objects with fancy reprs. I expect this to grow and contain more variations on dict, str, etc with fancy reprs.

Happy to move Log and Logs there if that makes sense.

has_what
image

who_has
image

@jakirkham
Copy link
Member

That's really neat Jacob! Thanks for putting this together 😄

@mrocklin
Copy link
Member

mrocklin commented May 26, 2021 via email

@jacobtomlinson
Copy link
Member Author

jacobtomlinson commented May 26, 2021

I'm keen to improve HTML reprs on ALL THE THINGS!

This seemed like low hanging fruit.

@jacobtomlinson
Copy link
Member Author

Test failure seems flaky and unrelated.

Given this is a small change to reprs only I'm going to hit merge as I want to build upon it. We can iterate on this later.

@crusaderky
Copy link
Collaborator

This breaks has_what and who_has for asynchronous clients.
CC @jrbourbeau I understand there should be a release this friday? This looks like a showstopper.

crusaderky pushed a commit to crusaderky/distributed that referenced this pull request May 27, 2021
@crusaderky crusaderky mentioned this pull request May 27, 2021
@jrbourbeau
Copy link
Member

Thanks for flagging @crusaderky! Do you have a link to a failing CI build you can point other to?

@crusaderky
Copy link
Collaborator

crusaderky commented May 27, 2021

https://github.com/dask/distributed/runs/2684366276

>       return HasWhat(self.sync(self.scheduler.has_what, workers=workers, **kwargs))
E       TypeError: 'coroutine' object is not iterable

The issue is that there are no tests in master that run who_has or has_what with an asynchronous Client. I just happened to add two in my PR.

@jrbourbeau
Copy link
Member

jrbourbeau commented May 27, 2021

Thanks @crusaderky -- linking to the referenced PR for others #4774

@quasiben
Copy link
Member

We are poking at this now. Thanks @crusaderky for flagging

@jacobtomlinson
Copy link
Member Author

Thanks for flagging this folks.

I expect this is because self.sync returns an asyncio future when in async mode. Therefore the type conversion fails.

The fix will likely be to move the call further down into the scheduler code, as long as it plays nicely with the comm.

I'm dealing with a family emergency this afternoon, so if you want to revert this in the meantime I'm happy with that.

@quasiben
Copy link
Member

Sorry you are having troubles. We'll take care of it.

@jrbourbeau
Copy link
Member

Just cross-referencing #4860 which fixes the TypeError: 'coroutine' object is not iterable we were running into

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.

6 participants