             (deliver completion-promise :deleted)
             (-> id->service
                 (update-in [service-id :service :instances] dec)
-                (assoc-in [service-id :id->instance instance-id :killed?] true)
-                (assoc-in [service-id :id->instance instance-id :shell-scheduler/process] nil)))
+                (update-in [service-id :id->instance instance-id] assoc
+                           :killed? true
+                           :message message
+                           :shell-scheduler/process nil)))
           (do
             (log/info "instance" instance-id "does not exist")
             (deliver completion-promise :no-such-instance-exists)

        (do (log/info "unhealthy instance exceeded its grace period, killing instance"
                      {:instance instance :start-time started-at :current-time current-time :grace-period-secs grace-period-secs})
            (kill-process! instance port->reservation-atom port-grace-period-ms)
            (assoc instance :failed? true
                            :killed? true
                            :flags #{:never-passed-health-checks}
                            :shell-scheduler/process nil))
        instance))
    instance))


      (if (and memory-used (> memory-used memory-allocated))
        (do (log/info "instance exceeds memory limit, killing instance" {:instance instance :memory-limit memory-allocated :memory-used memory-used})
            (kill-process! instance port->reservation-atom port-grace-period-ms)
            (assoc instance
              :failed? true
              :flags #{:memory-limit-exceeded}
              :healthy? false
              :killed? true
              :message "Exceeded allocated memory usage"
              :shell-scheduler/process nil))
        instance))
    instance))

