Skip to content
This repository has been archived by the owner on Jan 6, 2023. It is now read-only.

Commit

Permalink
Emit messages to logs when scheduler gives new job 0 peers, fixes #608.
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael Drogalis committed Jul 1, 2016
1 parent ce57f01 commit d75d695
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
3 changes: 2 additions & 1 deletion changes.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@
- Dependency change: Upgraded `org.btrplace/scheduler-choco` to `0.46`.
- Dependency change: Excluded ClojureScript from clj-fuzzy dependencies.
- Design change: Implemented peer-group ZooKeeper connection sharing. This reduces the number of ZooKeeper connections required per machine, and improves scheduler performance.
- Improvement: tasks now time out when being stopped, allowing a peer to be rescheduled in cases where the task is stuck. This is configured via the peer-config `:onyx.peer/stop-task-timeout-ms`.
- Enhancement: Tasks now time out when being stopped, allowing a peer to be rescheduled in cases where the task is stuck. This is configured via the peer-config `:onyx.peer/stop-task-timeout-ms`.
- Enhancement: A message is now emitted to the logs when a job is submitted, but does not start because of the scheduler gave it no peers.

#### 0.9.6

Expand Down
14 changes: 12 additions & 2 deletions src/onyx/log/commands/submit_job.clj
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,7 @@
(set (:killed-jobs replica))
(set (:completed-jobs replica)))
(:id args))
(do (info (format "Job ID %s has already been submitted, and will not be scheduled again." (:id args)))
replica)
replica
(-> replica
(update-in [:jobs] conj (:id args))
(update-in [:jobs] vec)
Expand Down Expand Up @@ -82,3 +81,14 @@
(s/defmethod extensions/fire-side-effects! [:submit-job :peer] :- State
[entry old new diff state]
(common/start-new-lifecycle old new diff state :peer-reallocated))

(s/defmethod extensions/fire-side-effects! [:submit-job :group] :- State
[{:keys [args] :as entry} old new diff state]
(when-not (seq diff)
(info (format "Job ID %s has already been submitted, and will not be scheduled again." (:id args))))

(let [allocations (get-in new [:allocations (:id args)])]
(when (zero? (count (reduce into [] (vals allocations))))
(info (format "Job ID %s has been submitted, but received no virtual peers to start its execution. If you were expecting your job to start now, either start more virtual peers or choose a different job scheduler." (:id args)))))

state)

0 comments on commit d75d695

Please sign in to comment.