no longer retry LocalCluster on errno.EADDRINUSE
@@ -3,7 +3,6 @@ from __future__ import annotations
import asyncio
import atexit
import copy
-import errno
import inspect
import json
import logging
@@ -1162,23 +1161,11 @@ class Client(SyncMethodMixin):
elif self._start_arg is None:
from distributed.deploy import LocalCluster
- try:
self.cluster = await LocalCluster(
loop=self.loop,
asynchronous=self._asynchronous,
**self._startup_kwargs,
)
- except OSError as e:
- if e.errno != errno.EADDRINUSE:
- raise
- # The default port was taken, use a random one
- self.cluster = await LocalCluster(
- scheduler_port=0,
- loop=self.loop,
- asynchronous=True,
- **self._startup_kwargs,
- )
-
address = self.cluster.scheduler_address
self._gather_semaphore = asyncio.Semaphore(5)
