Skip to content

Commit

Permalink
Use local executor again
Browse files Browse the repository at this point in the history
Otherwise we let a lingering thread start, which makes some tests
unhappy.

There is some chance that the worker might have an executor which
doesn't work well with asyncio.  That seems rare enough and this feature
seems fringe enough that I'm totally willing to take that chance.
  • Loading branch information
mrocklin committed Mar 25, 2022
1 parent 1b97b5d commit 67f7514
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions distributed/worker.py
Original file line number Diff line number Diff line change
Expand Up @@ -3699,11 +3699,11 @@ def _notify_plugins(self, method_name, *args, **kwargs):

async def benchmark_disk(self) -> dict[str, float]:
return await self.loop.run_in_executor(
None, benchmark_disk, self.local_directory
self.executor, benchmark_disk, self.local_directory
)

async def benchmark_memory(self) -> dict[str, float]:
return await self.loop.run_in_executor(None, benchmark_memory)
return await self.loop.run_in_executor(self.executor, benchmark_memory)

async def benchmark_network(self, address: str) -> dict[str, float]:
return await benchmark_network(rpc=self.rpc, address=address)
Expand Down

0 comments on commit 67f7514

Please sign in to comment.