I’m getting a weird projection failure
The githubcommits projection failed to process an event.
Handler: EventStore.Projections.Core.Services.v8.DefaultV8ProjectionStateHandler
Event Position: github: 288488
Message:
Terminated
Terminated? What did I do wrong?
The event being indexed is rather large, apparently somebody thought a 2MB commit message wasn’t a big deal. Is this a potential factor?
James said it might be something to do with the time it takes to run, how can I progress with this projection? This is costing me money by the hour
Cheers,
Rob
The projection itself is pretty simples
fromStream(“github”)
.when({
“$init”: function(state, ev) {
return {}
},
PushEvent: function(state, ev) {
for(var i = 0 ; i < ev.body.payload.commits.length; i++) {
var commit = ev.body.payload.commits[i]
var repo = ev.body.repo
emit(“commits”, “Commit”, {
commit: commit,
repo: repo
})
}
}
})
Rob,
For now, there is only one reason for this message. It is JS running for more than approx. 1 second handling a single event.
You must be doing something very complex or handle really large event/state to get this.
-yuriy
Okay, is there a way to disable or change this behaviour? It’s a large event, I can’t do much about that.
Sod it
if(commit.message.length > 2048) continue
Nobody needs to know except you and me and anybody else reading this mailing list.
Rob,
-
system projections: it was buggy initialization procedure. There was a screen allowing to create system projections manually. It needs to be patched to work for you. See details below.
-
large events: I’ll add an option on projection to configure timeout and fix error message.
Patching:
in the
singlenode-web\post-standard-projection.htm
replace the single line with $.ajax with: (changes in bold)
$.ajax("/projections/continuous?**emit=yes&checkpoints=yes&enabled=yes&**name=" + name + “&type=” + encodeURIComponent($("#type").val()), {
Then go to:
*projections->new-projection->“You can also post a standard projection” (link at the bottom)
*create projections you need
categorization projections need a source with a single ‘-’(minus) which is used as a separator in stream names.
-yuriy
thanks, I’ll give that a go