Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

learn-onyx SG issues #20

Open
lbradstreet opened this issue May 3, 2016 · 5 comments
Open

learn-onyx SG issues #20

lbradstreet opened this issue May 3, 2016 · 5 comments

Comments

@lbradstreet
Copy link
Member

My notes from the Singapore Onyx Dojo.

TO IMPROVE:
challenge-2-2: mention batch-size / batch-timeout required i.e. partial task-map entry
challenge-2-0: information model link is outdated now
challenge-1-3 DAG is a bit too crazy or hard to understand

  • challenge-2-3: grouping is not required to pass the test - test doesn’t properly track whether the correct peers have the correct output.
  • Even after adding :onyx/group-by-key, no error was printed for missing flux policy

Once added, but with invalid min-max-peers, this was printed:

  • actual: java.lang.IllegalArgumentException: No method in multimethod 'predicate-error-msg' for dispatch value: valid-flux-policy-min-max-n-peers

  • I've fixed this in core by now.

    actual: clojure.lang.ExceptionInfo: Task :identity failed validation. Error: {:onyx/flux-policy missing-required-key}
    and
    actual: clojure.lang.ExceptionInfo: Value does not match schema: (not (valid-flux-policy-min-max-n-peers a-clojure.lang.PersistentArrayMap))

  • this one is due to capturing stdout. Should go to stderr plus, we shouldn't depend on capturing standard out in learn-onyx.

GENERAL

  • n-peers is broken when you set n-peers in a catalog entry
@twashing
Copy link

I'm going through learn onyx now, and find it to be a great resource. One suggestion though, is to provide answers to the "questions" put forth in the missing code. At the moment, I can get 2-3 (grouping) to work, with only 1 peer. But if I try to up the peer count to 3, I get an error. I've since figured this out.

The catalog config.

{:onyx/name :read-segments
       :onyx/plugin :onyx.plugin.core-async/input
       :onyx/type :input
       :onyx/medium :core.async
       :onyx/batch-size batch-size
       :onyx/batch-timeout batch-timeout
       :onyx/max-peers 3  ;; -> fails with 3, but works with 1
       :onyx/doc "Reads segments from a core.async channel"}

      {:onyx/name :identity
       :onyx/fn :workshop.challenge-2-3/segment-identity
       :onyx/type :function
       :onyx/group-by-key :user-id
       :onyx/batch-size batch-size
       :onyx/batch-timeout batch-timeout
       :onyx/flux-policy :continue
       ;; :onyx/max-peers 3  ;; -> tried with and without this entry
      }

      {:onyx/name :write-segments
       :onyx/plugin :onyx.plugin.core-async/output
       :onyx/type :output
       :onyx/medium :core.async
       :onyx/batch-size batch-size
       :onyx/batch-timeout batch-timeout
       :onyx/max-peers 3  ;; -> fails with 3, but works with 1
       :onyx/doc "Writes segments to a core.async channel"}

The exception that I get when upping the peer count.

1. Unhandled clojure.lang.ExceptionInfo
   Input task not checkpointable, as task n-peers is not fixed.
   {:job-id #uuid "9d23c075-fb6c-e575-551c-4f65010c721d", :task :read-segments, :original-exception :clojure.lang.ExceptionInfo}

                  core.clj: 4617  clojure.core/ex-info
                  core.clj: 4617  clojure.core/ex-info
        task_lifecycle.clj:  183  onyx.peer.task-lifecycle/checkpoint-input
        task_lifecycle.clj:  173  onyx.peer.task-lifecycle/checkpoint-input
        task_lifecycle.clj:  826  onyx.peer.task-lifecycle.TaskStateMachine/exec
        task_lifecycle.clj:  429  onyx.peer.task-lifecycle/iteration
        task_lifecycle.clj:  422  onyx.peer.task-lifecycle/iteration
        task_lifecycle.clj:  448  onyx.peer.task-lifecycle/run-task-lifecycle!
        task_lifecycle.clj:  437  onyx.peer.task-lifecycle/run-task-lifecycle!
        task_lifecycle.clj:  902  onyx.peer.task-lifecycle/start-task-lifecycle!/fn
                 async.clj:  439  clojure.core.async/thread-call/fn
                  AFn.java:   22  clojure.lang.AFn/run
   ThreadPoolExecutor.java: 1142  java.util.concurrent.ThreadPoolExecutor/runWorker
   ThreadPoolExecutor.java:  617  java.util.concurrent.ThreadPoolExecutor$Worker/run
               Thread.java:  745  java.lang.Thread/run

As a newbie, it took me a long time to figure out that I needed both min-peers and max-peers.

{...
  :onyx/min-peers 3 
  :onyx/max-peers 3 
...}

@lbradstreet
Copy link
Member Author

@twashing thanks for the report. That error message should be better. I'll fix it in the next onyx release.

I'm thinking "Input task is not checkpointable, as the task onyx/n-peers is not set and :onyx/min-peers is not equal to :onyx/max-peers." would improve it a lot. Do you think you would have figured out what that meant?

@lbradstreet
Copy link
Member Author

@twashing I've improved the error message and updated examples to use beta12 which includes the new message.

@twashing
Copy link

twashing commented Apr 21, 2017

Hey @lbradstreet I think the main thing is communicating to the user, that those peer values have to be in a range. Your suggested error message would've helped a lot even though I don't know how the onyx/n-peers task is related to checkpointing. I was also thinking that spec could help with error messages.

Anyways, whatever works best for your code base. Thanks for the fast response. That was great!

@WaygoneWilco
Copy link

@lbradstreet Challenge 2-2 still has insufficient information for the learner, as you mentioned in your first comment. Only by coming to this thread did I understand that all catalog entries need to include batch-size and batch-timeout

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants