                           ]
                          )))
               (write-locked (:endpoint-socket-lock worker)
-                (reset! (:cached-task->node+port worker) my-assignment))
+                (reset! (:cached-task->node+port worker)
+                        (HashMap. my-assignment)))
               (doseq [endpoint remove-connections]
                 (.close (@(:cached-node+port->socket worker) endpoint)))
               (apply swap!
                      (:cached-node+port->socket worker)
-                     dissoc
+                     #(HashMap. (dissoc (into {} %1) %&))
                      remove-connections)
           )))))
 

            ;; try using multipart messages ... first sort the tuples by the target node (without changing the local ordering)
            
            (fast-list-iter [[task ser-tuple] drainer]
              ;; TODO: this lookup (with the vector is expensive)
              ;; TODO: write a batch of tuples here to every target worker  
              ;; group by node+port, do multipart send              
              (let [socket (node+port->socket (task->node+port task))]
                (msg/send socket task ser-tuple)
                ))))
        (.clear drainer)))))

              new-connections (set/difference needed-connections current-connections)
              remove-connections (set/difference current-connections needed-connections)]
              (swap! (:cached-node+port->socket worker)
                     #(HashMap. (merge (into {} %1) %2))
                     (into {}
                       (dofor [endpoint-str new-connections
                               :let [[node port] (string->endpoint endpoint-str)]]
                         [endpoint-str
                          (msg/connect
                           (:mq-context worker)
                           storm-id
