Add mechanism to abort further processing of a score#353
Conversation
| catch (ProcessingAbortedException abortException) | ||
| { | ||
| Console.WriteLine($"Aborting processing of score {item.Score.id}: {abortException.Message}"); | ||
| tags.Add("type:aborted"); |
There was a problem hiding this comment.
I was going to say "This is being added after the tags list is being materialised into an array, so probably won't work." but it turns out there's a second call to populate tags in the finally.
There was a problem hiding this comment.
Yeah, that was intentional if a bit obfuscated. I'd have caught the exception in the outermost scope but I can't rollback the transaction from there.
Part of me wondered if we even want to datadog this at all, but ultimately I decided that this might come useful.
| } | ||
|
|
||
| foreach (var p in enumerateValidProcessors(score)) | ||
| p.ApplyGlobal(score, conn); |
There was a problem hiding this comment.
Important to note we don't have the same coverage in ApplyGlobal. Maybe needs consideration for consistency..
There was a problem hiding this comment.
The issue with that is that it won't be super trivial because ApplyGlobal() runs after the transaction has already committed, so you'd have to actively manually rollback.
As far as I can tell from looking over our usages, we're mostly using ApplyGlobal() for side-/second-order effects of changes, so I don't think it needs that level of validation.
No description provided.