Skip to content

Commit

Permalink
[Alerting] remove internal OCC usage within alertsClient
Browse files Browse the repository at this point in the history
During development of #75553,
some issues came up with the optimistic concurrency control (OCC) we
were using internally within the alertsClient, via the `version`
option/property of the saved object.  The referenced PR updates new
fields in the alert from the taskManager task after the alertType
executor runs.  In some alertsClient methods, OCC is used to update
the alert which are requested via user requests.  And so in some
cases, version conflict errors were coming up when the alert was
updated by task manager, in the middle of one of these methods.  Note:
the SIEM function test cases stress test this REALLY well.

In this PR, we remove OCC from methods that were currently using it,
namely `update()`, `updateApiKey()`, `enable()`, `disable()`, and the
`[un]mute[All,Instance]()` methods.  Of these methods, OCC is really
only _practically_ needed by `update()`, but even for that we don't
support OCC in the API, yet; see: issue #74381 .

For cases where we know only attributes not contributing to AAD are
being updated, a new function is provided that does a partial update
on just those attributes, making partial updates for those attributes
a bit safer.  That will be used by PR #75553.
  • Loading branch information
pmuellr committed Sep 8, 2020
1 parent 02233e7 commit 384d0b6
Show file tree
Hide file tree
Showing 3 changed files with 218 additions and 286 deletions.
Loading

0 comments on commit 384d0b6

Please sign in to comment.