Fork me on GitHub
#onyx
<
2017-06-06
>
djjolicoeur02:06:58

anyone know it it is possible to pass a schema as a fn param for a task? or a record? {... :my/param Foo :onyx/params [:my/param]} I keep getting an java.lang.UnsupportedOperationException: nth not supported on this type: Symbol I didn't see any limitations in the docs, but maybe I'm looking in the wrong place

lucasbradstreet03:06:21

Yes, I’d have thought that would work. What does your function look like?

djjolicoeur03:06:46

(defn validate-segment [schema segment] (assoc segment ::valid? (boolean (not (s/check schema segment)))) where schema would be Foo in the example I posted above

lucasbradstreet03:06:08

that looks right

lucasbradstreet03:06:36

what’s the stack trace look like

lucasbradstreet03:06:44

it might be coming from somewhere I don’t expect it

djjolicoeur03:06:46

I'm not getting a stack trace, this is being thrown in from some tests and thats the only ouput I'm getting from cider-test-run-test. I haven't really starting digging into it, though I just wanted to make sure I wasn't chasing something that definitely wouldn't work before I started digging in.

lucasbradstreet03:06:22

Sure. I don’t see why it wouldn’t work, but I might be missing something

lucasbradstreet03:06:38

can you try setting :my/param to 3 and then checking whether the 3 flows through?

djjolicoeur03:06:06

strange though, if I change the param to a scalar, everything works. only when I pass in a schema def or record does it fail. I took a peek at the code that builds the partial and I don't see anything obvious that would prevent that from working

djjolicoeur03:06:26

ha, yeah I did try that and it does work.

djjolicoeur03:06:12

I'll do some more substantial debugging and post anything surprising in here

djjolicoeur03:06:39

thanks for the help

lucasbradstreet03:06:50

no worries, good luck.

lucasbradstreet03:06:12

maybe it just serialized your Foo schema as a symbol

lucasbradstreet03:06:25

rather than serializing the schema (which may not even work via a task map)

djjolicoeur03:06:00

hm. given the error I'm getting that makes sense.

lmergen07:06:09

hmm i'm trying to figure out why the zookeeper instance that onyx is using is constantly failing with OOM errors -- it appears as if onyx is putting quite a lot of state in zookeeper. what kind of requirements can I expect ? i'm currently -Xmxing zookeeper to 8GB, and apparently that's not enough

lmergen07:06:27

(before I dive into the GC logs a bit deeper to figure out the state of the java heap before it crashes, I'm trying to figure out what exactly would be reasonable and what not)

lucasbradstreet07:06:50

We've never given zookeeper instances more than a few gigs. Are your job definitions very big/contain a lot of data? Are you using the zookeeper state backend or s3?

lmergen07:06:09

i'm using zookeeper as an ABS backend yes

lmergen07:06:20

i already suspected that might have something to do with it

lmergen07:06:43

the job definitions are not very big, the data going through it, however, are

lmergen07:06:07

and i'm using a window that collects all this data in batches

lucasbradstreet07:06:54

Right, that would make a lot of sense then. There's no gc mechanism for state currently, and the zookeeper state backend is really only intended for minimal state or test environments

lmergen07:06:35

thanks for the info!

gardnervickers11:06:38

@lmergen Another thing to consider is that if you’re running in a container, the JVM defaults to 1/4 of the host memory, not the container memory limit.

lmergen11:06:12

@gardnervickers yeah i'm aware of that, that's why i'm running -Xms and -Xmx

lmergen11:06:25

but this is really zookeeper crashing hard on OOM errors

gardnervickers11:06:12

Ah cool ok, just making sure as it’s been the cause of problems for quite a few people in the past.

lmergen11:06:29

i do believe in the theory that this is probably ABS snapshotting large window functions state into zookeeper

lmergen11:06:03

so i'll be moving this to s3 ASAP

lmergen11:06:14

if that doesn't solve it, at least reduces the areas the problem can be in

michaeldrogalis15:06:19

@lmergen That should do the trick. We’re stashing fairly large windows in S3 in production.

stephenmhopper21:06:08

I have a question about error handling in Onyx

stephenmhopper21:06:11

My job has three different tasks. If an error occurs in any of those tasks, I want to send the error message to an error task that I have

stephenmhopper21:06:04

Do I need to have mappings in :workflow for each mapping from my tasks to my error task?

lucasbradstreet21:06:57

@stephenmhopper yes, you’ll need edges from each of your tasks to the error tasks, then you can use flow conditions to selectively emit to them

stephenmhopper21:06:50

The flow condition map looks something like this:

{:flow/from source-task
:flow/to [:error-task]
:flow/predicate ::constantly-true
:flow/short-circuit? true
:flow/thrown-exception? true}

stephenmhopper21:06:54

Right now, I have the mappings defined in the :workflow, but all of the messages are being handled by my error task. Do I need to update the predicate function to check and see if it’s an error before I do anything?

lucasbradstreet21:06:20

Yeah, currently you need one flow condition to route to the error task, which checks whether it’s an exception

lucasbradstreet21:06:57

and then you need another to route to the other task the rest of the time

lucasbradstreet21:06:58

Unfortunately flow conditions does not make this as easy as it should be. We have an outstanding issue to improve it.

stephenmhopper21:06:34

hm, okay, it looks like it’s still not quite working

stephenmhopper21:06:40

I’ve updated the :flow/predicate to be ::handle-error? where handle-error? is:

(defn handle-error? [event old-segment ex-obj all-new]
  (instance? java.lang.Exception ex-obj))

stephenmhopper21:06:02

But all of the segments are getting through regardless of what that function returns. Any ideas on what I’m missing?

stephenmhopper21:06:22

ah, okay, I added the other flow-condition thing like you mentioned (basically (complement handle-error?)) and now it works

lucasbradstreet21:06:47

Cool. Glad to hear it. It’s not so intuitive - we could do a lot better here.

stephenmhopper21:06:24

Yeah, thanks for the assistance. So, going forward, should I just plan on making two flow conditions any time I need flow conditions--1 for doing the thing I want, and the other for doing the complement of the thing I want?

lucasbradstreet22:06:52

For now, yes. We pulled it into a function that will add to our flow conditions

stephenmhopper22:06:45

Cool, thank you!