Skip to content

Commit af3b93e

Browse files
authored
Remove transition-counter-max from config (#6349)
1 parent 5ca7a5a commit af3b93e

7 files changed

Lines changed: 24 additions & 23 deletions

File tree

distributed/distributed-schema.yaml

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1027,13 +1027,6 @@ properties:
10271027
type: boolean
10281028
description: Enter Python Debugger on scheduling error
10291029

1030-
transition-counter-max:
1031-
oneOf:
1032-
- enum: [false]
1033-
- type: integer
1034-
description: Cause the scheduler or workers to break if they reach this
1035-
number of transitions
1036-
10371030
system-monitor:
10381031
type: object
10391032
description: |

distributed/distributed.yaml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -277,10 +277,6 @@ distributed:
277277
log-length: 10000 # default length of logs to keep in memory
278278
log-format: '%(asctime)s - %(name)s - %(levelname)s - %(message)s'
279279
pdb-on-err: False # enter debug mode on scheduling error
280-
# Cause scheduler and workers to break if they reach this many transitions.
281-
# Used to debug infinite transition loops.
282-
# Note: setting this will cause healthy long-running services to eventually break.
283-
transition-counter-max: False
284280
system-monitor:
285281
interval: 500ms
286282
event-loop: tornado

distributed/scheduler.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1283,6 +1283,7 @@ def __init__(
12831283
unrunnable: set,
12841284
validate: bool,
12851285
plugins: Iterable[SchedulerPlugin] = (),
1286+
transition_counter_max: int | Literal[False] = False,
12861287
**kwargs, # Passed verbatim to Server.__init__()
12871288
):
12881289
logger.info("State start")
@@ -1338,9 +1339,7 @@ def __init__(
13381339
/ 2.0
13391340
)
13401341
self.transition_counter = 0
1341-
self.transition_counter_max = dask.config.get(
1342-
"distributed.admin.transition-counter-max"
1343-
)
1342+
self.transition_counter_max = transition_counter_max
13441343

13451344
@property
13461345
def memory(self) -> MemoryState:
@@ -2878,6 +2877,7 @@ def __init__(
28782877
preload_argv=(),
28792878
plugins=(),
28802879
contact_address=None,
2880+
transition_counter_max=False,
28812881
**kwargs,
28822882
):
28832883
self._setup_logging(logger)
@@ -3109,6 +3109,7 @@ def __init__(
31093109
unrunnable=unrunnable,
31103110
validate=validate,
31113111
plugins=plugins,
3112+
transition_counter_max=transition_counter_max,
31123113
)
31133114
ServerNode.__init__(
31143115
self,

distributed/tests/test_scheduler.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3264,7 +3264,8 @@ async def test_transition_counter_max_worker(c, s, a):
32643264
@gen_cluster(
32653265
client=True,
32663266
nthreads=[("", 1)],
3267-
config={"distributed.admin.transition-counter-max": False},
3267+
scheduler_kwargs={"transition_counter_max": False},
3268+
worker_kwargs={"transition_counter_max": False},
32683269
)
32693270
async def test_disable_transition_counter_max(c, s, a, b):
32703271
"""Test that the cluster can run indefinitely if transition_counter_max is disabled.

distributed/tests/test_stress.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,8 @@ async def test_stress_steal(c, s, *workers):
219219
nthreads=[("", 1)] * 10,
220220
client=True,
221221
timeout=180,
222-
config={"distributed.admin.transition-counter-max": 500_000},
222+
scheduler_kwargs={"transition_counter_max": 500_000},
223+
worker_kwargs={"transition_counter_max": 500_000},
223224
)
224225
async def test_close_connections(c, s, *workers):
225226
da = pytest.importorskip("dask.array")
@@ -287,7 +288,8 @@ async def test_no_delay_during_large_transfer(c, s, w):
287288
client=True,
288289
Worker=Nanny,
289290
nthreads=[("", 2)] * 6,
290-
config={"distributed.admin.transition-counter-max": 500_000},
291+
scheduler_kwargs={"transition_counter_max": 500_000},
292+
worker_kwargs={"transition_counter_max": 500_000},
291293
)
292294
async def test_chaos_rechunk(c, s, *workers):
293295
s.allowed_failures = 10000

distributed/utils_test.py

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -989,12 +989,21 @@ async def test_foo(scheduler, worker1, worker2, pytest_fixture_a, pytest_fixture
989989
timeout = 3600
990990

991991
scheduler_kwargs = merge(
992-
{"dashboard": False, "dashboard_address": ":0"}, scheduler_kwargs
992+
dict(
993+
dashboard=False,
994+
dashboard_address=":0",
995+
transition_counter_max=50_000,
996+
),
997+
scheduler_kwargs,
993998
)
994999
worker_kwargs = merge(
995-
{"memory_limit": system.MEMORY_LIMIT, "death_timeout": 15}, worker_kwargs
1000+
dict(
1001+
memory_limit=system.MEMORY_LIMIT,
1002+
death_timeout=15,
1003+
transition_counter_max=50_000,
1004+
),
1005+
worker_kwargs,
9961006
)
997-
config = merge({"distributed.admin.transition-counter-max": 50_000}, config)
9981007

9991008
def _(func):
10001009
if not iscoroutinefunction(func):

distributed/worker.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -548,6 +548,7 @@ def __init__(
548548
lifetime: Any | None = None,
549549
lifetime_stagger: Any | None = None,
550550
lifetime_restart: bool | None = None,
551+
transition_counter_max: int | Literal[False] = False,
551552
###################################
552553
# Parameters to WorkerMemoryManager
553554
memory_limit: str | float = "auto",
@@ -610,9 +611,7 @@ def __init__(
610611
self.validate = validate
611612

612613
self.transition_counter = 0
613-
self.transition_counter_max = dask.config.get(
614-
"distributed.admin.transition-counter-max"
615-
)
614+
self.transition_counter_max = transition_counter_max
616615
self.incoming_transfer_log = deque(maxlen=100000)
617616
self.incoming_count = 0
618617
self.outgoing_transfer_log = deque(maxlen=100000)

0 commit comments

Comments
 (0)