-
Notifications
You must be signed in to change notification settings - Fork 8.4k
[Inference] regex worker for anonymization #227113
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
[Inference] regex worker for anonymization #227113
Conversation
Pinging @elastic/obs-ai-assistant (Team:Obs AI Assistant) |
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.
just passing by
// eslint-disable-next-line @kbn/imports/no_boundary_crossing | ||
require('../../../../../../../../src/setup_node_env'); |
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.
🙈 we really have zero supports for workers today
@@ -18,6 +18,9 @@ | |||
".storybook/**/*.js" | |||
], | |||
"kbn_references": [ | |||
{ | |||
"path": "../../../../../src/setup_node_env/tsconfig.json" |
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.
Why do we need this?
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.
setup_node_env
causes type errors without it.
...platform/plugins/shared/inference/server/chat_complete/anonymization/regex_worker_wrapper.js
Outdated
Show resolved
Hide resolved
…nian/kibana into anonymization-regex-worker
...platform/plugins/shared/inference/server/chat_complete/anonymization/regex_worker_wrapper.js
Outdated
Show resolved
Hide resolved
...platform/plugins/shared/inference/server/chat_complete/anonymization/regex_worker_wrapper.js
Outdated
Show resolved
Hide resolved
...platform/plugins/shared/inference/server/chat_complete/anonymization/regex_worker_wrapper.js
Outdated
Show resolved
Hide resolved
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.
approving ahead of time, but please take a look at x-pack/platform/plugins/shared/inference/server/chat_complete/anonymization/regex_worker_wrapper.js - specifically the /dist import. thanks for getting this done so quickly!
…nian/kibana into anonymization-regex-worker
💛 Build succeeded, but was flaky
Failed CI StepsTest Failures
Metrics [docs]Public APIs missing comments
Unknown metric groupsAPI count
ESLint disabled in files
ESLint disabled line counts
Total ESLint disabled count
History
|
Starting backport for target branches: 8.19, 9.1 |
## Summary Followup to elastic#225539 Adds an anonymization-regex worker pool to run user-defined regex patterns out-of-process, protecting the Node event-loop from catastrophic back-tracking. For internal use we have config to adjust or turn off the worker: • `enabled` – turn worker on/off • `minThreads` / `maxThreads` – worker size • `idleTimeout` – how long a worker thread is allowed to be idle • `taskTimeout` – per-regex task limit Contributions by windsurf(o3). (cherry picked from commit 1b9063a)
## Summary Followup to elastic#225539 Adds an anonymization-regex worker pool to run user-defined regex patterns out-of-process, protecting the Node event-loop from catastrophic back-tracking. For internal use we have config to adjust or turn off the worker: • `enabled` – turn worker on/off • `minThreads` / `maxThreads` – worker size • `idleTimeout` – how long a worker thread is allowed to be idle • `taskTimeout` – per-regex task limit Contributions by windsurf(o3). (cherry picked from commit 1b9063a)
💚 All backports created successfully
Note: Successful backport PRs will be merged automatically after passing CI. Questions ?Please refer to the Backport tool documentation |
# Backport This will backport the following commits from `main` to `9.1`: - [[Inference] regex worker for anonymization (#227113)](#227113) <!--- Backport version: 9.6.6 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sorenlouv/backport) <!--BACKPORT [{"author":{"name":"Sandra G","email":"[email protected]"},"sourceCommit":{"committedDate":"2025-07-11T20:52:28Z","message":"[Inference] regex worker for anonymization (#227113)\n\n## Summary\n\nFollowup to https://github.com/elastic/kibana/pull/225539\n\nAdds an anonymization-regex worker pool to run user-defined regex\npatterns out-of-process, protecting the Node event-loop from\ncatastrophic back-tracking.\n\nFor internal use we have config to adjust or turn off the worker:\n• `enabled` – turn worker on/off\n• `minThreads` / `maxThreads` – worker size\n• `idleTimeout` – how long a worker thread is allowed to be idle\n• `taskTimeout` – per-regex task limit\n\nContributions by windsurf(o3).","sha":"1b9063a61e2deaa56fae1f89cfce020a99f733d5","branchLabelMapping":{"^v9.2.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","Team:Obs AI Assistant","backport:version","v9.1.0","v8.19.0","v9.2.0"],"title":"[Inference] regex worker for anonymization","number":227113,"url":"https://github.com/elastic/kibana/pull/227113","mergeCommit":{"message":"[Inference] regex worker for anonymization (#227113)\n\n## Summary\n\nFollowup to https://github.com/elastic/kibana/pull/225539\n\nAdds an anonymization-regex worker pool to run user-defined regex\npatterns out-of-process, protecting the Node event-loop from\ncatastrophic back-tracking.\n\nFor internal use we have config to adjust or turn off the worker:\n• `enabled` – turn worker on/off\n• `minThreads` / `maxThreads` – worker size\n• `idleTimeout` – how long a worker thread is allowed to be idle\n• `taskTimeout` – per-regex task limit\n\nContributions by windsurf(o3).","sha":"1b9063a61e2deaa56fae1f89cfce020a99f733d5"}},"sourceBranch":"main","suggestedTargetBranches":["9.1","8.19"],"targetPullRequestStates":[{"branch":"9.1","label":"v9.1.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.19","label":"v8.19.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v9.2.0","branchLabelMappingKey":"^v9.2.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/227113","number":227113,"mergeCommit":{"message":"[Inference] regex worker for anonymization (#227113)\n\n## Summary\n\nFollowup to https://github.com/elastic/kibana/pull/225539\n\nAdds an anonymization-regex worker pool to run user-defined regex\npatterns out-of-process, protecting the Node event-loop from\ncatastrophic back-tracking.\n\nFor internal use we have config to adjust or turn off the worker:\n• `enabled` – turn worker on/off\n• `minThreads` / `maxThreads` – worker size\n• `idleTimeout` – how long a worker thread is allowed to be idle\n• `taskTimeout` – per-regex task limit\n\nContributions by windsurf(o3).","sha":"1b9063a61e2deaa56fae1f89cfce020a99f733d5"}}]}] BACKPORT--> Co-authored-by: Sandra G <[email protected]>
# Backport This will backport the following commits from `main` to `8.19`: - [[Inference] regex worker for anonymization (#227113)](#227113) <!--- Backport version: 9.6.6 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sorenlouv/backport) <!--BACKPORT [{"author":{"name":"Sandra G","email":"[email protected]"},"sourceCommit":{"committedDate":"2025-07-11T20:52:28Z","message":"[Inference] regex worker for anonymization (#227113)\n\n## Summary\n\nFollowup to https://github.com/elastic/kibana/pull/225539\n\nAdds an anonymization-regex worker pool to run user-defined regex\npatterns out-of-process, protecting the Node event-loop from\ncatastrophic back-tracking.\n\nFor internal use we have config to adjust or turn off the worker:\n• `enabled` – turn worker on/off\n• `minThreads` / `maxThreads` – worker size\n• `idleTimeout` – how long a worker thread is allowed to be idle\n• `taskTimeout` – per-regex task limit\n\nContributions by windsurf(o3).","sha":"1b9063a61e2deaa56fae1f89cfce020a99f733d5","branchLabelMapping":{"^v9.2.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","Team:Obs AI Assistant","backport:version","v9.1.0","v8.19.0","v9.2.0"],"title":"[Inference] regex worker for anonymization","number":227113,"url":"https://github.com/elastic/kibana/pull/227113","mergeCommit":{"message":"[Inference] regex worker for anonymization (#227113)\n\n## Summary\n\nFollowup to https://github.com/elastic/kibana/pull/225539\n\nAdds an anonymization-regex worker pool to run user-defined regex\npatterns out-of-process, protecting the Node event-loop from\ncatastrophic back-tracking.\n\nFor internal use we have config to adjust or turn off the worker:\n• `enabled` – turn worker on/off\n• `minThreads` / `maxThreads` – worker size\n• `idleTimeout` – how long a worker thread is allowed to be idle\n• `taskTimeout` – per-regex task limit\n\nContributions by windsurf(o3).","sha":"1b9063a61e2deaa56fae1f89cfce020a99f733d5"}},"sourceBranch":"main","suggestedTargetBranches":["9.1","8.19"],"targetPullRequestStates":[{"branch":"9.1","label":"v9.1.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.19","label":"v8.19.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v9.2.0","branchLabelMappingKey":"^v9.2.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/227113","number":227113,"mergeCommit":{"message":"[Inference] regex worker for anonymization (#227113)\n\n## Summary\n\nFollowup to https://github.com/elastic/kibana/pull/225539\n\nAdds an anonymization-regex worker pool to run user-defined regex\npatterns out-of-process, protecting the Node event-loop from\ncatastrophic back-tracking.\n\nFor internal use we have config to adjust or turn off the worker:\n• `enabled` – turn worker on/off\n• `minThreads` / `maxThreads` – worker size\n• `idleTimeout` – how long a worker thread is allowed to be idle\n• `taskTimeout` – per-regex task limit\n\nContributions by windsurf(o3).","sha":"1b9063a61e2deaa56fae1f89cfce020a99f733d5"}}]}] BACKPORT--> Co-authored-by: Sandra G <[email protected]>
Summary
Followup to #225539
Adds an anonymization-regex worker pool to run user-defined regex patterns out-of-process, protecting the Node event-loop from catastrophic back-tracking.
For internal use we have config to adjust or turn off the worker:
•
enabled
– turn worker on/off•
minThreads
/maxThreads
– worker size•
idleTimeout
– how long a worker thread is allowed to be idle•
taskTimeout
– per-regex task limitContributions by windsurf(o3).