-
Notifications
You must be signed in to change notification settings - Fork 8.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix memory leak in task manager task runner #193612
Conversation
Pinging @elastic/response-ops (Team:ResponseOps) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
💛 Build succeeded, but was flaky
Failed CI StepsMetrics [docs]
To update your PR or re-run it, just comment with: |
In this PR, I'm fixing a memory leak that was introduced in elastic#190093 where every task runner class object wouldn't free up in memory because it subscribed to the `pollIntervalConfiguration$` observable. To fix this, I moved the observable up a class into `TaskPollingLifecycle` which only gets created once on plugin start and then pass down the pollInterval value via a function call the task runner class can call. (cherry picked from commit cf6e8b5)
💚 All backports created successfully
Note: Successful backport PRs will be merged automatically after passing CI. Questions ?Please refer to the Backport tool documentation |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, nice catch!
# Backport This will backport the following commits from `main` to `8.x`: - [Fix memory leak in task manager task runner (#193612)](#193612) <!--- Backport version: 9.4.3 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT [{"author":{"name":"Mike Côté","email":"[email protected]"},"sourceCommit":{"committedDate":"2024-09-20T17:52:26Z","message":"Fix memory leak in task manager task runner (#193612)\n\nIn this PR, I'm fixing a memory leak that was introduced in\r\nhttps://github.com//pull/190093 where every task runner\r\nclass object wouldn't free up in memory because it subscribed to the\r\n`pollIntervalConfiguration# Backport This will backport the following commits from `main` to `8.x`: - [Fix memory leak in task manager task runner (#193612)](#193612) <!--- Backport version: 9.4.3 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT observable. To fix this, I moved the\r\nobservable up a class into `TaskPollingLifecycle` which only gets\r\ncreated once on plugin start and then pass down the pollInterval value\r\nvia a function call the task runner class can call.","sha":"cf6e8b5ba971fffe2a57e1a7c573e60cc2fbe280","branchLabelMapping":{"^v9.0.0$":"main","^v8.16.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","Feature:Task Manager","Team:ResponseOps","v9.0.0","backport:prev-minor","v8.16.0"],"title":"Fix memory leak in task manager task runner","number":193612,"url":"https://github.com/elastic/kibana/pull/193612","mergeCommit":{"message":"Fix memory leak in task manager task runner (#193612)\n\nIn this PR, I'm fixing a memory leak that was introduced in\r\nhttps://github.com//pull/190093 where every task runner\r\nclass object wouldn't free up in memory because it subscribed to the\r\n`pollIntervalConfiguration# Backport This will backport the following commits from `main` to `8.x`: - [Fix memory leak in task manager task runner (#193612)](#193612) <!--- Backport version: 9.4.3 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT observable. To fix this, I moved the\r\nobservable up a class into `TaskPollingLifecycle` which only gets\r\ncreated once on plugin start and then pass down the pollInterval value\r\nvia a function call the task runner class can call.","sha":"cf6e8b5ba971fffe2a57e1a7c573e60cc2fbe280"}},"sourceBranch":"main","suggestedTargetBranches":["8.x"],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/193612","number":193612,"mergeCommit":{"message":"Fix memory leak in task manager task runner (#193612)\n\nIn this PR, I'm fixing a memory leak that was introduced in\r\nhttps://github.com//pull/190093 where every task runner\r\nclass object wouldn't free up in memory because it subscribed to the\r\n`pollIntervalConfiguration# Backport This will backport the following commits from `main` to `8.x`: - [Fix memory leak in task manager task runner (#193612)](#193612) <!--- Backport version: 9.4.3 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT observable. To fix this, I moved the\r\nobservable up a class into `TaskPollingLifecycle` which only gets\r\ncreated once on plugin start and then pass down the pollInterval value\r\nvia a function call the task runner class can call.","sha":"cf6e8b5ba971fffe2a57e1a7c573e60cc2fbe280"}},{"branch":"8.x","label":"v8.16.0","branchLabelMappingKey":"^v8.16.0$","isSourceBranch":false,"state":"NOT_CREATED"}]}] BACKPORT--> Co-authored-by: Mike Côté <[email protected]>
In this PR, I'm fixing a memory leak that was introduced in #190093 where every task runner class object wouldn't free up in memory because it subscribed to the
pollIntervalConfiguration$
observable. To fix this, I moved the observable up a class intoTaskPollingLifecycle
which only gets created once on plugin start and then pass down the pollInterval value via a function call the task runner class can call.