Merge branch 'master' into 0.9.0
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 6a90251..627f348 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -6,7 +6,7 @@
  * Build upgraded to leiningen 2.0
  * Revamped Trident spout interfaces to support more dynamic spouts, such as a spout who reads from a changing set of brokers
 
-## Unreleased (0.8.2)
+## 0.8.2
 
  * Added backtype.storm.scheduler.IsolationScheduler. This lets you run topologies that are completely isolated at the machine level. Configure Nimbus to isolate certain topologies, and how many machines to give to each of those topologies, with the isolation.scheduler.machines config in Nimbus's storm.yaml. Topologies run on the cluster that are not listed there will share whatever remaining machines there are on the cluster after machines are allocated to the listed topologies.
  * Storm UI now uses nimbus.host to find Nimbus rather than always using localhost (thanks Frostman)
diff --git a/src/clj/backtype/storm/daemon/nimbus.clj b/src/clj/backtype/storm/daemon/nimbus.clj
index 0cfc38f..1c4cf30 100644
--- a/src/clj/backtype/storm/daemon/nimbus.clj
+++ b/src/clj/backtype/storm/daemon/nimbus.clj
@@ -1164,4 +1164,3 @@
 
 (defn -main []
   (-launch (standalone-nimbus)))
-
diff --git a/src/clj/backtype/storm/scheduler/IsolationScheduler.clj b/src/clj/backtype/storm/scheduler/IsolationScheduler.clj
index c532b36..bd15f18 100644
--- a/src/clj/backtype/storm/scheduler/IsolationScheduler.clj
+++ b/src/clj/backtype/storm/scheduler/IsolationScheduler.clj
@@ -202,7 +202,13 @@
              allocated-topologies
              (leftover-topologies topologies <>)
              (DefaultScheduler/default-schedule <> cluster))
-        (log-warn "Unstable to isolate topologies " (pr-str failed-iso-topologies) ". Will wait for enough resources for isolated topologies before allocating any other resources.")
+        (do
+          (log-warn "Unable to isolate topologies " (pr-str failed-iso-topologies) ". No machine had enough worker slots to run the remaining workers for these topologies. Clearing all other resources and will wait for enough resources for isolated topologies before allocating any other resources.")
+          ;; clear workers off all hosts that are not blacklisted
+          (doseq [[host slots] (host->used-slots cluster)]
+            (if-not (.isBlacklistedHost cluster host)
+              (.freeSlots cluster slots)
+              )))
         ))
     (.setBlacklistedHosts cluster orig-blacklist)
     ))
diff --git a/src/jvm/backtype/storm/scheduler/Cluster.java b/src/jvm/backtype/storm/scheduler/Cluster.java
index daececc..951bd3a 100644
--- a/src/jvm/backtype/storm/scheduler/Cluster.java
+++ b/src/jvm/backtype/storm/scheduler/Cluster.java
@@ -63,6 +63,10 @@
     public boolean isBlackListed(String supervisorId) {
         return blackListedHosts != null && blackListedHosts.contains(getHost(supervisorId));        
     }
+
+    public boolean isBlacklistedHost(String host) {
+        return blackListedHosts != null && blackListedHosts.contains(host);  
+    }
     
     public String getHost(String supervisorId) {
         return inimbus.getHostName(supervisors, supervisorId);