Skip to content

Commit 1437e68

Browse files
committed
scylla_node: preserve node SMP across restarts
ScyllaNode.start() was resetting _smp to the default value (2) unless the test explicitly called ScyllaNode.set_smp(). This caused nodes started with a different "--smp" value from command lines and then restarted to lose their previous CPU configuration: ``` cluster.start(jvm_args=["--smp", "1"], wait_for_binary_proto=True) node1.stop(gently=False) node1.start(wait_for_binary_proto=True) ``` The last command started a node with --smp=2. Keep the existing _smp value on restart, and only update it when explicitly requested (via set_smp() or an explicit --smp override in start options). Fixes: https://scylladb.atlassian.net/browse/SCYLLADB-521
1 parent d283ed4 commit 1437e68

File tree

1 file changed

+12
-10
lines changed

1 file changed

+12
-10
lines changed

ccmlib/scylla_node.py

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -701,19 +701,21 @@ def start(self, join_ring=True, no_wait=False, verbose=False,
701701
if not self._mem_mb_set_during_test and '--memory' in cmd_args:
702702
self._memory = self.parse_size(cmd_args['--memory'][0])
703703

704+
# use '--smp' in jvm_args if was not set by the test
705+
if not self._smp_set_during_test and '--smp' in cmd_args:
706+
self._smp = int(cmd_args['--smp'][0])
707+
704708
ext_args = env_args
705709
ext_args.update(cmd_args)
706710
for k, v in ext_args.items():
707-
if k == '--smp':
708-
# get smp from args if not set by the test
709-
if not self._smp_set_during_test:
710-
self._smp = int(v[0])
711-
elif k != '--memory':
712-
if v and all(v):
713-
for val in v:
714-
args += [k, val]
715-
else:
716-
args.append(k)
711+
if k in ('--memory', '--smp'):
712+
continue
713+
714+
if v and all(v):
715+
for val in v:
716+
args += [k, val]
717+
else:
718+
args.append(k)
717719

718720
args.extend(translated_args)
719721

0 commit comments

Comments
 (0)