Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
# Backport This will backport the following commits from `main` to `8.7`: - [[ML] Fixing ML saved object cache (#151122)](#151122) <!--- Backport version: 8.9.7 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT [{"author":{"name":"James Gowdy","email":"[email protected]"},"sourceCommit":{"committedDate":"2023-02-20T09:41:14Z","message":"[ML] Fixing ML saved object cache (#151122)\n\nPR #146155 introduced a cache of\r\nthe ML saved objects to the `mlSavedObjectService` to improve\r\nperformance.\r\n\r\nThis can cause a problem for the module `setup` function when called\r\nmore than once from an external plugin in a single request.\r\nA single instance of the `mlSavedObjectService` is used per request and\r\nso for each `setup` call the same cache is used. Any saved objects\r\ncreated, updated or removed in the first `setup` call are missing from\r\nthe cache in subsequent calls.\r\n\r\nThis means any jobs being created in the second call to `setup` cannot\r\nbe opened as do not exist in the cache.\r\n\r\nThis PR clears the cache after every write action to the saved object\r\nclient causing it to be repopulated the next time it is read.","sha":"f6bb0f4fccab76791ef292ebd90df581c3fbdac6","branchLabelMapping":{"^v8.8.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["bug","non-issue",":ml","Feature:Anomaly Detection","release_note:skip","v8.7.0","v8.8.0"],"number":151122,"url":"https://github.com/elastic/kibana/pull/151122","mergeCommit":{"message":"[ML] Fixing ML saved object cache (#151122)\n\nPR #146155 introduced a cache of\r\nthe ML saved objects to the `mlSavedObjectService` to improve\r\nperformance.\r\n\r\nThis can cause a problem for the module `setup` function when called\r\nmore than once from an external plugin in a single request.\r\nA single instance of the `mlSavedObjectService` is used per request and\r\nso for each `setup` call the same cache is used. Any saved objects\r\ncreated, updated or removed in the first `setup` call are missing from\r\nthe cache in subsequent calls.\r\n\r\nThis means any jobs being created in the second call to `setup` cannot\r\nbe opened as do not exist in the cache.\r\n\r\nThis PR clears the cache after every write action to the saved object\r\nclient causing it to be repopulated the next time it is read.","sha":"f6bb0f4fccab76791ef292ebd90df581c3fbdac6"}},"sourceBranch":"main","suggestedTargetBranches":["8.7"],"targetPullRequestStates":[{"branch":"8.7","label":"v8.7.0","labelRegex":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v8.8.0","labelRegex":"^v8.8.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/151122","number":151122,"mergeCommit":{"message":"[ML] Fixing ML saved object cache (#151122)\n\nPR #146155 introduced a cache of\r\nthe ML saved objects to the `mlSavedObjectService` to improve\r\nperformance.\r\n\r\nThis can cause a problem for the module `setup` function when called\r\nmore than once from an external plugin in a single request.\r\nA single instance of the `mlSavedObjectService` is used per request and\r\nso for each `setup` call the same cache is used. Any saved objects\r\ncreated, updated or removed in the first `setup` call are missing from\r\nthe cache in subsequent calls.\r\n\r\nThis means any jobs being created in the second call to `setup` cannot\r\nbe opened as do not exist in the cache.\r\n\r\nThis PR clears the cache after every write action to the saved object\r\nclient causing it to be repopulated the next time it is read.","sha":"f6bb0f4fccab76791ef292ebd90df581c3fbdac6"}}]}] BACKPORT--> Co-authored-by: James Gowdy <[email protected]>
- Loading branch information