Skip to content

Commit c7ffcc0

Browse files
committed
fix(nemesis): avoid masking KillNemesis in nemesis
this is minor change that allow to avoid masking KillNemesis in _refuse_connection_from_banned_node fix: #11816
1 parent 5126790 commit c7ffcc0

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

sdcm/nemesis.py

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5413,10 +5413,18 @@ def drop_keyspace(node):
54135413
nemesis_label=f"{simulate_node_unavailability.__name__}") as working_node, ExitStack() as stack:
54145414
stack.enter_context(node_operations.block_loaders_payload_for_scylla_node(
54155415
self.target_node, loader_nodes=self.loaders.nodes))
5416-
stack.callback(drop_keyspace, node=working_node)
54175416
target_host_id = self.target_node.host_id
5418-
stack.callback(self._remove_node_add_node, verification_node=working_node, node_to_remove=self.target_node,
5419-
remove_node_host_id=target_host_id)
5417+
5418+
def _finalizer(exc_type, *_):
5419+
if exc_type is not KillNemesis:
5420+
self._remove_node_add_node(
5421+
verification_node=working_node, node_to_remove = self.target_node,
5422+
remove_node_host_id=target_host_id
5423+
)
5424+
drop_keyspace(node=working_node)
5425+
return False
5426+
stack.push(_finalizer)
5427+
54205428
self.tester.create_keyspace(keyspace_name, replication_factor=3)
54215429
self.tester.create_table(name=table_name, keyspace_name=keyspace_name, key_type="bigint",
54225430
columns={"name": "text"})

0 commit comments

Comments
 (0)