Skip to content

Commit

Permalink
Merge pull request #1733 from davidmarin/terminate-active-clusters
Browse files Browse the repository at this point in the history
more efficient terminate-idle-clusters (fixes #1722)
  • Loading branch information
David Marin committed Feb 23, 2018
2 parents 78824c8 + a747dfe commit d93f649
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions mrjob/tools/emr/terminate_idle_clusters.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,10 +152,11 @@ def _maybe_terminate_clusters(dry_run=False,
num_pending = 0
num_running = 0

# We don't filter by cluster state because we want this to work even
# if Amazon adds another kind of idle state.
# include RUNNING to catch clusters with PENDING jobs that
# never ran (see #365).
for cluster_summary in _boto3_paginate(
'Clusters', emr_client, 'list_clusters'):
'Clusters', emr_client, 'list_clusters',
ClusterStates=['WAITING', 'RUNNING']):

cluster_id = cluster_summary['Id']

Expand Down

0 comments on commit d93f649

Please sign in to comment.