             (ratelimit/spend! quota/per-user-per-pool-launch-rate-limiter token-key 1)
             (ratelimit/spend! compute-cluster-launch-rate-limiter ratelimit/compute-cluster-launch-rate-limiter-key 1))
           (prom/inc prom/scheduler-jobs-launched {:pool pool-name :compute-cluster (cc/compute-cluster-name compute-cluster)})
-          (locking fenzo
-            (-> fenzo
-                (.getTaskAssigner)
-                (.call task-request hostname)))))
+          ;; When Fenzo is specified, we need to tell it that the task was
+          ;; scheduled. Fenzo can be nil when launching tasks for a Kubernetes
+          ;; Scheduler pool.
+          (when fenzo
+            (locking fenzo
+              (-> fenzo
+                  (.getTaskAssigner)
+                  (.call task-request hostname))))))
       (catch Throwable t
         (log-structured/error "Error launching tasks for compute cluster"
                               {:pool pool-name :compute-cluster (cc/compute-cluster-name compute-cluster)}

             compute-clusters-for-pool (filter #(cc/autoscaling? % pool-name) compute-clusters)
             launch-distributed-job-fn
             (fn [[compute-cluster jobs]]
               (let [kill-lock-object (cc/kill-lock-object compute-cluster)
                     task-metadata-seq (jobs->kubernetes-task-metadata jobs pool-name mesos-run-as-user compute-cluster)
                     task-txns (map (fn [job metadata] (job->task-txn job metadata compute-cluster)) jobs task-metadata-seq)]
                 (try
                   (log-structured/debug "Acquiring lock to commit tasks and and launch to Kubernetes."
                                         {:pool pool-name :compute-cluster compute-cluster})
                   (.. kill-lock-object readLock lock)
                   (timers/time!
                    (timers/timer (metric-title "distribute-jobs-to-kubernetes-transact-task-duration" pool-name))
                    (datomic/transact
                     conn
                     (reduce into [] task-txns)
                     (fn [e]
                       (log-structured/warn "Transaction timed out, so these tasks might be present"
                                            "in Datomic without actually having been launched in compute cluster"
                                            {:compute-cluster compute-cluster :pool pool-name} e)
                       (throw e))))
                   (timers/time!
                    (timers/timer (metric-title "distribute-jobs-to-kubernetes-launch-duration" pool-name))
                    (cc/launch-tasks
                     compute-cluster pool-name [{:task-metadata-seq task-metadata-seq}]
                     (fn process-task-post-launch!
                       [{:keys [_ task-request]}]
                       (let [user (get-in task-request [:job :job/user])
                             compute-cluster-launch-rate-limiter (cc/launch-rate-limiter compute-cluster)
                             token-key (quota/pool+user->token-key pool-name user)]
                         (ratelimit/spend! quota/per-user-per-pool-launch-rate-limiter token-key 1)
                         (ratelimit/spend! compute-cluster-launch-rate-limiter ratelimit/compute-cluster-launch-rate-limiter-key 1))
                       (prom/inc prom/scheduler-jobs-launched {:pool pool-name :compute-cluster (cc/compute-cluster-name compute-cluster)}))))
                   (finally
                     (.. kill-lock-object readLock unlock)))))]
         (log-structured/info "Launching jobs in Kubernetes" {:pool pool-name})
         (distribute-and-launch-jobs considerable-jobs pool-name compute-clusters-for-pool
                                     job->acceptable-compute-clusters-fn launch-distributed-job-fn)

                                         e)
                    (throw e)))))

            ;; Launching the matched tasks MUST happen after the above transaction in
            ;; order to allow a transaction failure (due to failed preconditions)
            ;; to block the launch.
            (prom/with-duration
              prom/scheduler-launch-all-matched-tasks-submit-duration {:pool pool-name}
              (timers/time!
                (timers/timer (metric-title "handle-resource-offer!-mesos-submit-duration" pool-name))
                (let [_ (log-structured/info "Launching matched tasks for compute cluster"
                                             {:pool pool-name :compute-cluster compute-cluster-name})]
                  ;; Mesos offers must be launched within a timeout, otherwise they expire worthless.
                  ;; We track that metric in order to catch the problem. Note that this is only 
                  ;; applicable to Mesos tasks on Fenzo. When Mesos goes away, this metric ceases 
                  ;; to be important and this can be deleted.
                  (when should-metric-offer-match-time
                    (doseq [match matches]
                      (timers/stop (-> match :leases first :offer :offer-match-timer))
                      (-> match :leases first :offer :offer-match-timer-prom-stop-fn)))
                  (#(launch-matches! compute-cluster pool-name matches fenzo)))))
            (finally
              (.. kill-lock-object readLock unlock))))))))
