Skip to content

Addressing #5159 (IPv6 dask-worker support) by propagating empty host… - #5197

Merged
jacobtomlinson merged 10 commits into
dask:mainfrom
wwoods:main
Aug 23, 2021
Merged

jacobtomlinson merged 10 commits into
dask:mainfrom
wwoods:main

Conversation

@wwoods

@wwoods wwoods commented Aug 10, 2021 •

Copy link
Copy Markdown
Contributor

… correctly

@jacobtomlinson Let me know what you think. Thanks!

@GPUtester

Copy link
Copy Markdown
Collaborator

Can one of the admins verify this patch?

@jrbourbeau

Copy link
Copy Markdown
Member

add to allowlist

@wwoods

wwoods commented Aug 10, 2021

Copy link
Copy Markdown
Contributor Author

Given tests are failing, but they're also failing for the commit that this is based on, I will probably rebase this PR to 9569e08 so we get a better idea of which failures are actually a result of this change.

wwoods added 2 commits August 10, 2021 17:42
… work from busy Worker

Prior to this commit, task results required would be fetch only from local workers if they were available. If all local workers were busy, but the work were available on another machine, this would result in an indefinite delay. This patch allows local workers to be temporarily rejected, allowing for remote workers to provide the data when all local workers are busy.
@wwoods

wwoods commented Aug 11, 2021

Copy link
Copy Markdown
Contributor Author

Quick note -- I found a bug in the tests that could reasonably crop up in production while I was debugging some of the other test issues.

The other bug is that, prior to this PR, workers would only fetch task data from a local worker when one is available, even if that worker is busy. One could imagine a set of long-running tasks that tie up the local worker, while a remote worker also has the data available and is not busy. In this case, the worker would wait on the local, long-running tasks, rather than just asking the remote worker for the data.

There's a TODO on the fix -- I didn't see any time.monotonic usage in distributed/worker.py, so I was presuming that sort of timeout was to be avoided. The new busy_workers attribute will reset its status for workers which hold task data when all such workers were previously marked busy; however, this is not ideal as a local worker could be rejected for quite some time before being the only option with the data.

So, I was thinking of resetting the busy_workers attribute when a task dependency is newly requested. I'm guessing that would be a good approach?

2nd TODO is line 2187 in distributed/workers.py should use workers_not_busy. Wanted to get this changeset pushed earlier though since I think it will fix the remaining broken tests, leaving only this parallel issue to be resolved.

@wwoods

wwoods commented Aug 12, 2021

Copy link
Copy Markdown
Contributor Author

I ended up splitting the busy_workers into #5206; this PR should be good to go if the tests pass and a maintainer thinks it looks OK.

Comment thread distributed/worker.py Outdated
Comment on lines +560 to +562
assert host_address.count(":") <= 1 or host_address.startswith(
"["
), "Host address with IPv6 must be bracketed like '[::1]'"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I've not seen assert used like this before. Would it be better to raise an exception here more explicitly?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

It would be different but same effect -- happy to make the change if you would like.

Other than this, does the PR look good?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

It would be different but same effect

Functionally it would be the same but by using a more familiar pattern the code is more maintainable. (I'm sure @mrocklin wrote a good blog post about the value of writing code that a novice contributor could understand but I am failing to find it)

Otherwise yeah this seems like a great change.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Sure, change to ValueError pushed.

@wwoods

wwoods commented Aug 20, 2021

Copy link
Copy Markdown
Contributor Author

Just in case something about this PR is waiting on the CI tests to pass -- the remaining failures appear to be transient failures, unrelated to these changes.

@jacobtomlinson

Copy link
Copy Markdown
Member

Yeah sorry I was waiting for CI to finish before merging and forgot to come back here.

@jacobtomlinson
jacobtomlinson merged commit 17c08e5 into dask:main Aug 23, 2021
@jacobtomlinson

Copy link
Copy Markdown
Member

Thanks @wwoods

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.

dask-worker broken with IPv6?

4 participants