Files
SWAGATO BAURIandDarshan Jain ee32a179cf feat(pod-disruption): support parallel pod deletion (#1536)
* feat(pod-disruption): support parallel pod deletion

Introduce 'kill_mode' field to pod disruption scenario to support parallel
deletion of pods. By default 'kill_mode' is 'sequential' preserving
existing behavior. When set to 'parallel', it concurrently deletes pods
using threading and queue, enabling effective testing of disruption scenarios
like etcd quorum loss where simultaneous disruption is necessary.

Resolves: #1516

Assisted-by: Claude <noreply@anthropic.com>
Signed-off-by: swagatobauri <swagato731123@gmail.com>

* fix(pod-disruption): validate kill_mode and address PR feedback

- Validate 'kill_mode' at parse time: fallback to 'sequential' and log a
  warning if an unknown string is provided, preventing silent failures.
- Update test_parallel_mode_calls_delete_concurrently to use a
  threading.Barrier to definitively prove concurrent thread execution.
- Revert 'scenarios/openshift/etcd.yml' to default non-destructive behavior
  and extract parallel quorum loss example into a new explicitly named file
  'etcd_quorum_loss.yml'.

Assisted-by: Claude <noreply@anthropic.com>
Signed-off-by: swagatobauri <swagato731123@gmail.com>

* refactor(pod-disruption): optimize imports and cap threads

- Reorganize imports in pod_disruption_scenario_plugin.py to comply with
  standard PEP-8 grouping (stdlib, third-party, local).
- Replace unbounded OS thread spawning in _delete_pods_parallel with
  concurrent.futures.ThreadPoolExecutor. Capped max_workers to 10 to
  prevent excessive concurrent API calls that could overload the Kubernetes
  API server under aggressive scenario configurations.

Assisted-by: Claude <noreply@anthropic.com>
Signed-off-by: swagatobauri <swagato731123@gmail.com>

* refactor(pod-disruption): align execution config with network_chaos_ng

- Renamed config field from 'kill_mode' to 'execution' for consistency
  with the network_chaos_ng plugin.
- Changed valid values from 'sequential|parallel' to 'serial|parallel'.
- Replaced fallback warning with strict validation, raising ValueError on
  invalid execution values, aligning with the strict validation pattern
  used elsewhere in the codebase.
- Updated relevant tests and scenario YAML templates.

Assisted-by: Claude <noreply@anthropic.com>
Signed-off-by: swagatobauri <swagato731123@gmail.com>

* fix(pod-disruption): remove unused logging import in models.py

Following the switch from a warning log to raising a ValueError for
invalid execution types, the logging import was no longer used.

Assisted-by: Claude <noreply@anthropic.com>
Signed-off-by: swagatobauri <swagato731123@gmail.com>

---------

Signed-off-by: swagatobauri <swagato731123@gmail.com>
Co-authored-by: Darshan Jain <darjain@redhat.com>
2026-08-06 18:46:25 +05:30
..
2024-07-29 15:31:37 -04:00