Skip to content
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

[Fleet] Fix unattended Transforms in integration packages not automatically restarting after reauthorizing #210217

Merged
merged 5 commits into from
Feb 13, 2025

Conversation

qn895
Copy link
Member

@qn895 qn895 commented Feb 7, 2025

Summary

This PR partially addresses an issue with elastic/integrations#12486 where the transform doesn't "restart" immediately after reauthorizing. This is because for unattended transform, calling _start will come back with 409 transform already started error. So this PR tracks if the transform has settings.unattended: true, if yes, stop the transform first before starting.

Without this step, the transform will retry again and become healthy again anyway but it takes longer for that retry to happen, so this PR speeds up the process of retrying.

Checklist

Check the PR satisfies following conditions.

Reviewers should verify this PR satisfies this list as well.

  • Any text added follows EUI's writing guidelines, uses sentence case text and includes i18n support
  • Documentation was added for features that require explanation or tutorials
  • Unit or functional tests were updated or added to match the most common scenarios
  • If a plugin configuration key changed, check if it needs to be allowlisted in the cloud and added to the docker list
  • This was checked for breaking HTTP API changes, and any breaking changes have been approved by the breaking-change committee. The release_note:breaking label should be applied in these situations.
  • Flaky Test Runner was used on any tests changed
  • The PR description includes the appropriate Release Notes section, and the correct release_note:* label is applied per the guidelines

Identify risks

Does this PR introduce any risks? For example, consider risks like hard to test bugs, performance regression, potential of data loss.

Describe the risk, its severity, and mitigation for each identified risk. Invite stakeholders and evaluate how to proceed before merging.

@qn895 qn895 added release_note:fix :ml Team:Fleet Team label for Observability Data Collection Fleet team v9.0.0 v8.18.0 v8.19.0 v8.17.3 v8.16.5 labels Feb 7, 2025
@qn895 qn895 self-assigned this Feb 7, 2025
@qn895 qn895 requested a review from a team as a code owner February 7, 2025 16:26
@elasticmachine
Copy link
Contributor

Pinging @elastic/ml-ui (:ml)

@elasticmachine
Copy link
Contributor

Pinging @elastic/fleet (Team:Fleet)

@qn895 qn895 added the backport:version Backport to applied version labels label Feb 7, 2025
@qn895
Copy link
Member Author

qn895 commented Feb 7, 2025

@elasticmachine merge upstream

Copy link
Contributor

@peteharverson peteharverson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code changes LGTM

@susan-shu-c
Copy link
Member

Hi folks, is anything else needed for this PR to merge? Thanks again for the swift work!

).then((results) => results.flat());
);

authorizedTransforms = await Promise.all(transformsPromises).then((results) => results.flat());
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably worth putting this in a pMap and limit the concurrency, to avoid to may concurrent requests

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

@nchaulet nchaulet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 🚀

@elasticmachine
Copy link
Contributor

💛 Build succeeded, but was flaky

Failed CI Steps

Metrics [docs]

✅ unchanged

History

cc @qn895

@qn895 qn895 merged commit e710f09 into elastic:main Feb 13, 2025
10 checks passed
@kibanamachine
Copy link
Contributor

Starting backport for target branches: 8.16, 8.17, 8.18, 8.x, 9.0

https://github.com/elastic/kibana/actions/runs/13301324699

kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Feb 13, 2025
…ically restarting after reauthorizing (elastic#210217)

## Summary

This PR partially addresses an issue with
elastic/integrations#12486 where the transform
doesn't "restart" immediately after reauthorizing. This is because for
unattended transform, calling `_start` will come back with 409 transform
already started error. So this PR tracks if the transform has
`settings.unattended: true`, if yes, stop the transform first before
starting.

Without this step, the transform will retry again and become healthy
again anyway but it takes longer for that retry to happen, so this PR
speeds up the process of retrying.

### Checklist

Check the PR satisfies following conditions.

Reviewers should verify this PR satisfies this list as well.

- [ ] Any text added follows [EUI's writing
guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses
sentence case text and includes [i18n
support](https://github.com/elastic/kibana/blob/main/src/platform/packages/shared/kbn-i18n/README.md)
- [ ]
[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)
was added for features that require explanation or tutorials
- [ ] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios
- [ ] If a plugin configuration key changed, check if it needs to be
allowlisted in the cloud and added to the [docker
list](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker)
- [ ] This was checked for breaking HTTP API changes, and any breaking
changes have been approved by the breaking-change committee. The
`release_note:breaking` label should be applied in these situations.
- [ ] [Flaky Test
Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was
used on any tests changed
- [ ] The PR description includes the appropriate Release Notes section,
and the correct `release_note:*` label is applied per the
[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)

### Identify risks

Does this PR introduce any risks? For example, consider risks like hard
to test bugs, performance regression, potential of data loss.

Describe the risk, its severity, and mitigation for each identified
risk. Invite stakeholders and evaluate how to proceed before merging.

- [ ] [See some risk
examples](https://github.com/elastic/kibana/blob/main/RISK_MATRIX.mdx)
- [ ] ...

---------

Co-authored-by: Elastic Machine <[email protected]>
(cherry picked from commit e710f09)
@kibanamachine
Copy link
Contributor

💔 Some backports could not be created

Status Branch Result
8.16 Backport failed because of merge conflicts
8.17 Backport failed because of merge conflicts
8.18 Backport failed because of merge conflicts
8.x Backport failed because of merge conflicts
9.0

Note: Successful backport PRs will be merged automatically after passing CI.

Manual backport

To create the backport manually run:

node scripts/backport --pr 210217

Questions ?

Please refer to the Backport tool documentation

kibanamachine added a commit that referenced this pull request Feb 13, 2025
…utomatically restarting after reauthorizing (#210217) (#210950)

# Backport

This will backport the following commits from `main` to `9.0`:
- [[Fleet] Fix unattended Transforms in integration packages not
automatically restarting after reauthorizing
(#210217)](#210217)

<!--- Backport version: 9.4.3 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT [{"author":{"name":"Quynh Nguyen
(Quinn)","email":"[email protected]"},"sourceCommit":{"committedDate":"2025-02-13T05:49:58Z","message":"[Fleet]
Fix unattended Transforms in integration packages not automatically
restarting after reauthorizing (#210217)\n\n## Summary\n\nThis PR
partially addresses an issue
with\nhttps://github.com/elastic/integrations/issues/12486 where the
transform\ndoesn't \"restart\" immediately after reauthorizing. This is
because for\nunattended transform, calling `_start` will come back with
409 transform\nalready started error. So this PR tracks if the transform
has\n`settings.unattended: true`, if yes, stop the transform first
before\nstarting.\n\nWithout this step, the transform will retry again
and become healthy\nagain anyway but it takes longer for that retry to
happen, so this PR\nspeeds up the process of retrying.\n\n\n###
Checklist\n\nCheck the PR satisfies following conditions. \n\nReviewers
should verify this PR satisfies this list as well.\n\n- [ ] Any text
added follows [EUI's
writing\nguidelines](https://elastic.github.io/eui/#/guidelines/writing),
uses\nsentence case text and includes
[i18n\nsupport](https://github.com/elastic/kibana/blob/main/src/platform/packages/shared/kbn-i18n/README.md)\n-
[
]\n[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)\nwas
added for features that require explanation or tutorials\n- [ ] [Unit or
functional\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\nwere
updated or added to match the most common scenarios\n- [ ] If a plugin
configuration key changed, check if it needs to be\nallowlisted in the
cloud and added to the
[docker\nlist](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker)\n-
[ ] This was checked for breaking HTTP API changes, and any
breaking\nchanges have been approved by the breaking-change committee.
The\n`release_note:breaking` label should be applied in these
situations.\n- [ ] [Flaky
Test\nRunner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1)
was\nused on any tests changed\n- [ ] The PR description includes the
appropriate Release Notes section,\nand the correct `release_note:*`
label is applied per
the\n[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)\n\n###
Identify risks\n\nDoes this PR introduce any risks? For example,
consider risks like hard\nto test bugs, performance regression,
potential of data loss.\n\nDescribe the risk, its severity, and
mitigation for each identified\nrisk. Invite stakeholders and evaluate
how to proceed before merging.\n\n- [ ] [See some
risk\nexamples](https://github.com/elastic/kibana/blob/main/RISK_MATRIX.mdx)\n-
[ ] ...\n\n---------\n\nCo-authored-by: Elastic Machine
<[email protected]>","sha":"e710f09d0c1159a9018ff6b9dfbac151509213f9","branchLabelMapping":{"^v9.1.0$":"main","^v8.19.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:fix",":ml","Team:Fleet","v9.0.0","backport:version","v8.18.0","v9.1.0","v8.19.0","v8.17.3","v8.16.5"],"title":"[Fleet]
Fix unattended Transforms in integration packages not automatically
restarting after
reauthorizing","number":210217,"url":"https://github.com/elastic/kibana/pull/210217","mergeCommit":{"message":"[Fleet]
Fix unattended Transforms in integration packages not automatically
restarting after reauthorizing (#210217)\n\n## Summary\n\nThis PR
partially addresses an issue
with\nhttps://github.com/elastic/integrations/issues/12486 where the
transform\ndoesn't \"restart\" immediately after reauthorizing. This is
because for\nunattended transform, calling `_start` will come back with
409 transform\nalready started error. So this PR tracks if the transform
has\n`settings.unattended: true`, if yes, stop the transform first
before\nstarting.\n\nWithout this step, the transform will retry again
and become healthy\nagain anyway but it takes longer for that retry to
happen, so this PR\nspeeds up the process of retrying.\n\n\n###
Checklist\n\nCheck the PR satisfies following conditions. \n\nReviewers
should verify this PR satisfies this list as well.\n\n- [ ] Any text
added follows [EUI's
writing\nguidelines](https://elastic.github.io/eui/#/guidelines/writing),
uses\nsentence case text and includes
[i18n\nsupport](https://github.com/elastic/kibana/blob/main/src/platform/packages/shared/kbn-i18n/README.md)\n-
[
]\n[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)\nwas
added for features that require explanation or tutorials\n- [ ] [Unit or
functional\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\nwere
updated or added to match the most common scenarios\n- [ ] If a plugin
configuration key changed, check if it needs to be\nallowlisted in the
cloud and added to the
[docker\nlist](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker)\n-
[ ] This was checked for breaking HTTP API changes, and any
breaking\nchanges have been approved by the breaking-change committee.
The\n`release_note:breaking` label should be applied in these
situations.\n- [ ] [Flaky
Test\nRunner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1)
was\nused on any tests changed\n- [ ] The PR description includes the
appropriate Release Notes section,\nand the correct `release_note:*`
label is applied per
the\n[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)\n\n###
Identify risks\n\nDoes this PR introduce any risks? For example,
consider risks like hard\nto test bugs, performance regression,
potential of data loss.\n\nDescribe the risk, its severity, and
mitigation for each identified\nrisk. Invite stakeholders and evaluate
how to proceed before merging.\n\n- [ ] [See some
risk\nexamples](https://github.com/elastic/kibana/blob/main/RISK_MATRIX.mdx)\n-
[ ] ...\n\n---------\n\nCo-authored-by: Elastic Machine
<[email protected]>","sha":"e710f09d0c1159a9018ff6b9dfbac151509213f9"}},"sourceBranch":"main","suggestedTargetBranches":["9.0","8.18","8.x","8.17","8.16"],"targetPullRequestStates":[{"branch":"9.0","label":"v9.0.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.18","label":"v8.18.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v9.1.0","branchLabelMappingKey":"^v9.1.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/210217","number":210217,"mergeCommit":{"message":"[Fleet]
Fix unattended Transforms in integration packages not automatically
restarting after reauthorizing (#210217)\n\n## Summary\n\nThis PR
partially addresses an issue
with\nhttps://github.com/elastic/integrations/issues/12486 where the
transform\ndoesn't \"restart\" immediately after reauthorizing. This is
because for\nunattended transform, calling `_start` will come back with
409 transform\nalready started error. So this PR tracks if the transform
has\n`settings.unattended: true`, if yes, stop the transform first
before\nstarting.\n\nWithout this step, the transform will retry again
and become healthy\nagain anyway but it takes longer for that retry to
happen, so this PR\nspeeds up the process of retrying.\n\n\n###
Checklist\n\nCheck the PR satisfies following conditions. \n\nReviewers
should verify this PR satisfies this list as well.\n\n- [ ] Any text
added follows [EUI's
writing\nguidelines](https://elastic.github.io/eui/#/guidelines/writing),
uses\nsentence case text and includes
[i18n\nsupport](https://github.com/elastic/kibana/blob/main/src/platform/packages/shared/kbn-i18n/README.md)\n-
[
]\n[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)\nwas
added for features that require explanation or tutorials\n- [ ] [Unit or
functional\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\nwere
updated or added to match the most common scenarios\n- [ ] If a plugin
configuration key changed, check if it needs to be\nallowlisted in the
cloud and added to the
[docker\nlist](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker)\n-
[ ] This was checked for breaking HTTP API changes, and any
breaking\nchanges have been approved by the breaking-change committee.
The\n`release_note:breaking` label should be applied in these
situations.\n- [ ] [Flaky
Test\nRunner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1)
was\nused on any tests changed\n- [ ] The PR description includes the
appropriate Release Notes section,\nand the correct `release_note:*`
label is applied per
the\n[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)\n\n###
Identify risks\n\nDoes this PR introduce any risks? For example,
consider risks like hard\nto test bugs, performance regression,
potential of data loss.\n\nDescribe the risk, its severity, and
mitigation for each identified\nrisk. Invite stakeholders and evaluate
how to proceed before merging.\n\n- [ ] [See some
risk\nexamples](https://github.com/elastic/kibana/blob/main/RISK_MATRIX.mdx)\n-
[ ] ...\n\n---------\n\nCo-authored-by: Elastic Machine
<[email protected]>","sha":"e710f09d0c1159a9018ff6b9dfbac151509213f9"}},{"branch":"8.x","label":"v8.19.0","branchLabelMappingKey":"^v8.19.0$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.17","label":"v8.17.3","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.16","label":"v8.16.5","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->

Co-authored-by: Quynh Nguyen (Quinn) <[email protected]>
@susan-shu-c
Copy link
Member

susan-shu-c commented Feb 14, 2025

Hi, we're trying this out the PR #210217 but unable to conduct the following:

Cloud:
8.16.1->8.18.0 upgrade

Local, using SNAPSHOTS:
8.16.1->8.18.0 upgrade
8.16.1->9.0.0 upgrade

[Update: 8.18.0 -> 9.0.0 works, not to be confused with 8.16.1 -> 8.18.0 (unhealthy) -> 9.0.0]

I saw that the backport hasn't been able to complete?
cc @qn895 @sodhikirti07

@qn895
Copy link
Member Author

qn895 commented Feb 14, 2025

Sorry @susan-shu-c I missed the conflicts in the backports. Working on backporting now 👍

@susan-shu-c
Copy link
Member

Thanks @qn895 ! Thankfully it's not blocking 9.0 as we found that 8.18 -> 9.0 did work, but since the overall test plan requires the 8.x -> 8.x testing, we still need to complete it at some point. Just confirming that the urgency is lower than any other 9.0 fixes, though still related. Appreciate it!

qn895 added a commit that referenced this pull request Feb 17, 2025
…utomatically restarting after reauthorizing (#210217) (#211316)

# Backport

This will backport the following commits from `main` to `8.x`:
- [[Fleet] Fix unattended Transforms in integration packages not
automatically restarting after reauthorizing
(#210217)](#210217)

<!--- Backport version: 9.6.4 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sorenlouv/backport)

<!--BACKPORT [{"author":{"name":"Quynh Nguyen
(Quinn)","email":"[email protected]"},"sourceCommit":{"committedDate":"2025-02-13T05:49:58Z","message":"[Fleet]
Fix unattended Transforms in integration packages not automatically
restarting after reauthorizing (#210217)\n\n## Summary\n\nThis PR
partially addresses an issue
with\nhttps://github.com/elastic/integrations/issues/12486 where the
transform\ndoesn't \"restart\" immediately after reauthorizing. This is
because for\nunattended transform, calling `_start` will come back with
409 transform\nalready started error. So this PR tracks if the transform
has\n`settings.unattended: true`, if yes, stop the transform first
before\nstarting.\n\nWithout this step, the transform will retry again
and become healthy\nagain anyway but it takes longer for that retry to
happen, so this PR\nspeeds up the process of retrying.\n\n\n###
Checklist\n\nCheck the PR satisfies following conditions. \n\nReviewers
should verify this PR satisfies this list as well.\n\n- [ ] Any text
added follows [EUI's
writing\nguidelines](https://elastic.github.io/eui/#/guidelines/writing),
uses\nsentence case text and includes
[i18n\nsupport](https://github.com/elastic/kibana/blob/main/src/platform/packages/shared/kbn-i18n/README.md)\n-
[
]\n[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)\nwas
added for features that require explanation or tutorials\n- [ ] [Unit or
functional\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\nwere
updated or added to match the most common scenarios\n- [ ] If a plugin
configuration key changed, check if it needs to be\nallowlisted in the
cloud and added to the
[docker\nlist](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker)\n-
[ ] This was checked for breaking HTTP API changes, and any
breaking\nchanges have been approved by the breaking-change committee.
The\n`release_note:breaking` label should be applied in these
situations.\n- [ ] [Flaky
Test\nRunner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1)
was\nused on any tests changed\n- [ ] The PR description includes the
appropriate Release Notes section,\nand the correct `release_note:*`
label is applied per
the\n[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)\n\n###
Identify risks\n\nDoes this PR introduce any risks? For example,
consider risks like hard\nto test bugs, performance regression,
potential of data loss.\n\nDescribe the risk, its severity, and
mitigation for each identified\nrisk. Invite stakeholders and evaluate
how to proceed before merging.\n\n- [ ] [See some
risk\nexamples](https://github.com/elastic/kibana/blob/main/RISK_MATRIX.mdx)\n-
[ ] ...\n\n---------\n\nCo-authored-by: Elastic Machine
<[email protected]>","sha":"e710f09d0c1159a9018ff6b9dfbac151509213f9","branchLabelMapping":{"^v9.1.0$":"main","^v8.19.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:fix",":ml","Team:Fleet","v9.0.0","backport:version","v8.18.0","v9.1.0","v8.19.0","v8.17.3","v8.16.5"],"title":"[Fleet]
Fix unattended Transforms in integration packages not automatically
restarting after
reauthorizing","number":210217,"url":"https://github.com/elastic/kibana/pull/210217","mergeCommit":{"message":"[Fleet]
Fix unattended Transforms in integration packages not automatically
restarting after reauthorizing (#210217)\n\n## Summary\n\nThis PR
partially addresses an issue
with\nhttps://github.com/elastic/integrations/issues/12486 where the
transform\ndoesn't \"restart\" immediately after reauthorizing. This is
because for\nunattended transform, calling `_start` will come back with
409 transform\nalready started error. So this PR tracks if the transform
has\n`settings.unattended: true`, if yes, stop the transform first
before\nstarting.\n\nWithout this step, the transform will retry again
and become healthy\nagain anyway but it takes longer for that retry to
happen, so this PR\nspeeds up the process of retrying.\n\n\n###
Checklist\n\nCheck the PR satisfies following conditions. \n\nReviewers
should verify this PR satisfies this list as well.\n\n- [ ] Any text
added follows [EUI's
writing\nguidelines](https://elastic.github.io/eui/#/guidelines/writing),
uses\nsentence case text and includes
[i18n\nsupport](https://github.com/elastic/kibana/blob/main/src/platform/packages/shared/kbn-i18n/README.md)\n-
[
]\n[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)\nwas
added for features that require explanation or tutorials\n- [ ] [Unit or
functional\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\nwere
updated or added to match the most common scenarios\n- [ ] If a plugin
configuration key changed, check if it needs to be\nallowlisted in the
cloud and added to the
[docker\nlist](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker)\n-
[ ] This was checked for breaking HTTP API changes, and any
breaking\nchanges have been approved by the breaking-change committee.
The\n`release_note:breaking` label should be applied in these
situations.\n- [ ] [Flaky
Test\nRunner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1)
was\nused on any tests changed\n- [ ] The PR description includes the
appropriate Release Notes section,\nand the correct `release_note:*`
label is applied per
the\n[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)\n\n###
Identify risks\n\nDoes this PR introduce any risks? For example,
consider risks like hard\nto test bugs, performance regression,
potential of data loss.\n\nDescribe the risk, its severity, and
mitigation for each identified\nrisk. Invite stakeholders and evaluate
how to proceed before merging.\n\n- [ ] [See some
risk\nexamples](https://github.com/elastic/kibana/blob/main/RISK_MATRIX.mdx)\n-
[ ] ...\n\n---------\n\nCo-authored-by: Elastic Machine
<[email protected]>","sha":"e710f09d0c1159a9018ff6b9dfbac151509213f9"}},"sourceBranch":"main","suggestedTargetBranches":["8.18","8.x","8.17","8.16"],"targetPullRequestStates":[{"branch":"9.0","label":"v9.0.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"url":"https://github.com/elastic/kibana/pull/210950","number":210950,"state":"MERGED","mergeCommit":{"sha":"a8d9319cdd70a1ead8228d0da858c71bd709efe6","message":"[9.0]
[Fleet] Fix unattended Transforms in integration packages not
automatically restarting after reauthorizing (#210217) (#210950)\n\n#
Backport\n\nThis will backport the following commits from `main` to
`9.0`:\n- [[Fleet] Fix unattended Transforms in integration packages
not\nautomatically restarting after
reauthorizing\n(#210217)](https://github.com/elastic/kibana/pull/210217)\n\n<!---
Backport version: 9.4.3 -->\n\n### Questions ?\nPlease refer to the
[Backport
tool\ndocumentation](https://github.com/sqren/backport)\n\n<!--BACKPORT
[{\"author\":{\"name\":\"Quynh
Nguyen\n(Quinn)\",\"email\":\"[email protected]\"},\"sourceCommit\":{\"committedDate\":\"2025-02-13T05:49:58Z\",\"message\":\"[Fleet]\nFix
unattended Transforms in integration packages not
automatically\nrestarting after reauthorizing (#210217)\\n\\n##
Summary\\n\\nThis PR\npartially addresses an
issue\nwith\\nhttps://github.com/elastic/integrations/issues/12486 where
the\ntransform\\ndoesn't \\\"restart\\\" immediately after
reauthorizing. This is\nbecause for\\nunattended transform, calling
`_start` will come back with\n409 transform\\nalready started error. So
this PR tracks if the transform\nhas\\n`settings.unattended: true`, if
yes, stop the transform first\nbefore\\nstarting.\\n\\nWithout this
step, the transform will retry again\nand become healthy\\nagain anyway
but it takes longer for that retry to\nhappen, so this PR\\nspeeds up
the process of retrying.\\n\\n\\n###\nChecklist\\n\\nCheck the PR
satisfies following conditions. \\n\\nReviewers\nshould verify this PR
satisfies this list as well.\\n\\n- [ ] Any text\nadded follows
[EUI's\nwriting\\nguidelines](https://elastic.github.io/eui/#/guidelines/writing),\nuses\\nsentence
case text and
includes\n[i18n\\nsupport](https://github.com/elastic/kibana/blob/main/src/platform/packages/shared/kbn-i18n/README.md)\\n-\n[\n]\\n[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)\\nwas\nadded
for features that require explanation or tutorials\\n- [ ] [Unit
or\nfunctional\\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\\nwere\nupdated
or added to match the most common scenarios\\n- [ ] If a
plugin\nconfiguration key changed, check if it needs to be\\nallowlisted
in the\ncloud and added to
the\n[docker\\nlist](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker)\\n-\n[
] This was checked for breaking HTTP API changes, and
any\nbreaking\\nchanges have been approved by the breaking-change
committee.\nThe\\n`release_note:breaking` label should be applied in
these\nsituations.\\n- [ ]
[Flaky\nTest\\nRunner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1)\nwas\\nused
on any tests changed\\n- [ ] The PR description includes
the\nappropriate Release Notes section,\\nand the correct
`release_note:*`\nlabel is applied
per\nthe\\n[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)\\n\\n###\nIdentify
risks\\n\\nDoes this PR introduce any risks? For example,\nconsider
risks like hard\\nto test bugs, performance regression,\npotential of
data loss.\\n\\nDescribe the risk, its severity, and\nmitigation for
each identified\\nrisk. Invite stakeholders and evaluate\nhow to proceed
before merging.\\n\\n- [ ] [See
some\nrisk\\nexamples](https://github.com/elastic/kibana/blob/main/RISK_MATRIX.mdx)\\n-\n[
] ...\\n\\n---------\\n\\nCo-authored-by: Elastic
Machine\n<[email protected]>\",\"sha\":\"e710f09d0c1159a9018ff6b9dfbac151509213f9\",\"branchLabelMapping\":{\"^v9.1.0$\":\"main\",\"^v8.19.0$\":\"8.x\",\"^v(\\\\d+).(\\\\d+).\\\\d+$\":\"$1.$2\"}},\"sourcePullRequest\":{\"labels\":[\"release_note:fix\",\":ml\",\"Team:Fleet\",\"v9.0.0\",\"backport:version\",\"v8.18.0\",\"v9.1.0\",\"v8.19.0\",\"v8.17.3\",\"v8.16.5\"],\"title\":\"[Fleet]\nFix
unattended Transforms in integration packages not
automatically\nrestarting
after\nreauthorizing\",\"number\":210217,\"url\":\"https://github.com/elastic/kibana/pull/210217\",\"mergeCommit\":{\"message\":\"[Fleet]\nFix
unattended Transforms in integration packages not
automatically\nrestarting after reauthorizing (#210217)\\n\\n##
Summary\\n\\nThis PR\npartially addresses an
issue\nwith\\nhttps://github.com/elastic/integrations/issues/12486 where
the\ntransform\\ndoesn't \\\"restart\\\" immediately after
reauthorizing. This is\nbecause for\\nunattended transform, calling
`_start` will come back with\n409 transform\\nalready started error. So
this PR tracks if the transform\nhas\\n`settings.unattended: true`, if
yes, stop the transform first\nbefore\\nstarting.\\n\\nWithout this
step, the transform will retry again\nand become healthy\\nagain anyway
but it takes longer for that retry to\nhappen, so this PR\\nspeeds up
the process of retrying.\\n\\n\\n###\nChecklist\\n\\nCheck the PR
satisfies following conditions. \\n\\nReviewers\nshould verify this PR
satisfies this list as well.\\n\\n- [ ] Any text\nadded follows
[EUI's\nwriting\\nguidelines](https://elastic.github.io/eui/#/guidelines/writing),\nuses\\nsentence
case text and
includes\n[i18n\\nsupport](https://github.com/elastic/kibana/blob/main/src/platform/packages/shared/kbn-i18n/README.md)\\n-\n[\n]\\n[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)\\nwas\nadded
for features that require explanation or tutorials\\n- [ ] [Unit
or\nfunctional\\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\\nwere\nupdated
or added to match the most common scenarios\\n- [ ] If a
plugin\nconfiguration key changed, check if it needs to be\\nallowlisted
in the\ncloud and added to
the\n[docker\\nlist](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker)\\n-\n[
] This was checked for breaking HTTP API changes, and
any\nbreaking\\nchanges have been approved by the breaking-change
committee.\nThe\\n`release_note:breaking` label should be applied in
these\nsituations.\\n- [ ]
[Flaky\nTest\\nRunner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1)\nwas\\nused
on any tests changed\\n- [ ] The PR description includes
the\nappropriate Release Notes section,\\nand the correct
`release_note:*`\nlabel is applied
per\nthe\\n[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)\\n\\n###\nIdentify
risks\\n\\nDoes this PR introduce any risks? For example,\nconsider
risks like hard\\nto test bugs, performance regression,\npotential of
data loss.\\n\\nDescribe the risk, its severity, and\nmitigation for
each identified\\nrisk. Invite stakeholders and evaluate\nhow to proceed
before merging.\\n\\n- [ ] [See
some\nrisk\\nexamples](https://github.com/elastic/kibana/blob/main/RISK_MATRIX.mdx)\\n-\n[
] ...\\n\\n---------\\n\\nCo-authored-by: Elastic
Machine\n<[email protected]>\",\"sha\":\"e710f09d0c1159a9018ff6b9dfbac151509213f9\"}},\"sourceBranch\":\"main\",\"suggestedTargetBranches\":[\"9.0\",\"8.18\",\"8.x\",\"8.17\",\"8.16\"],\"targetPullRequestStates\":[{\"branch\":\"9.0\",\"label\":\"v9.0.0\",\"branchLabelMappingKey\":\"^v(\\\\d+).(\\\\d+).\\\\d+$\",\"isSourceBranch\":false,\"state\":\"NOT_CREATED\"},{\"branch\":\"8.18\",\"label\":\"v8.18.0\",\"branchLabelMappingKey\":\"^v(\\\\d+).(\\\\d+).\\\\d+$\",\"isSourceBranch\":false,\"state\":\"NOT_CREATED\"},{\"branch\":\"main\",\"label\":\"v9.1.0\",\"branchLabelMappingKey\":\"^v9.1.0$\",\"isSourceBranch\":true,\"state\":\"MERGED\",\"url\":\"https://github.com/elastic/kibana/pull/210217\",\"number\":210217,\"mergeCommit\":{\"message\":\"[Fleet]\nFix
unattended Transforms in integration packages not
automatically\nrestarting after reauthorizing (#210217)\\n\\n##
Summary\\n\\nThis PR\npartially addresses an
issue\nwith\\nhttps://github.com/elastic/integrations/issues/12486 where
the\ntransform\\ndoesn't \\\"restart\\\" immediately after
reauthorizing. This is\nbecause for\\nunattended transform, calling
`_start` will come back with\n409 transform\\nalready started error. So
this PR tracks if the transform\nhas\\n`settings.unattended: true`, if
yes, stop the transform first\nbefore\\nstarting.\\n\\nWithout this
step, the transform will retry again\nand become healthy\\nagain anyway
but it takes longer for that retry to\nhappen, so this PR\\nspeeds up
the process of retrying.\\n\\n\\n###\nChecklist\\n\\nCheck the PR
satisfies following conditions. \\n\\nReviewers\nshould verify this PR
satisfies this list as well.\\n\\n- [ ] Any text\nadded follows
[EUI's\nwriting\\nguidelines](https://elastic.github.io/eui/#/guidelines/writing),\nuses\\nsentence
case text and
includes\n[i18n\\nsupport](https://github.com/elastic/kibana/blob/main/src/platform/packages/shared/kbn-i18n/README.md)\\n-\n[\n]\\n[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)\\nwas\nadded
for features that require explanation or tutorials\\n- [ ] [Unit
or\nfunctional\\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\\nwere\nupdated
or added to match the most common scenarios\\n- [ ] If a
plugin\nconfiguration key changed, check if it needs to be\\nallowlisted
in the\ncloud and added to
the\n[docker\\nlist](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker)\\n-\n[
] This was checked for breaking HTTP API changes, and
any\nbreaking\\nchanges have been approved by the breaking-change
committee.\nThe\\n`release_note:breaking` label should be applied in
these\nsituations.\\n- [ ]
[Flaky\nTest\\nRunner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1)\nwas\\nused
on any tests changed\\n- [ ] The PR description includes
the\nappropriate Release Notes section,\\nand the correct
`release_note:*`\nlabel is applied
per\nthe\\n[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)\\n\\n###\nIdentify
risks\\n\\nDoes this PR introduce any risks? For example,\nconsider
risks like hard\\nto test bugs, performance regression,\npotential of
data loss.\\n\\nDescribe the risk, its severity, and\nmitigation for
each identified\\nrisk. Invite stakeholders and evaluate\nhow to proceed
before merging.\\n\\n- [ ] [See
some\nrisk\\nexamples](https://github.com/elastic/kibana/blob/main/RISK_MATRIX.mdx)\\n-\n[
] ...\\n\\n---------\\n\\nCo-authored-by: Elastic
Machine\n<[email protected]>\",\"sha\":\"e710f09d0c1159a9018ff6b9dfbac151509213f9\"}},{\"branch\":\"8.x\",\"label\":\"v8.19.0\",\"branchLabelMappingKey\":\"^v8.19.0$\",\"isSourceBranch\":false,\"state\":\"NOT_CREATED\"},{\"branch\":\"8.17\",\"label\":\"v8.17.3\",\"branchLabelMappingKey\":\"^v(\\\\d+).(\\\\d+).\\\\d+$\",\"isSourceBranch\":false,\"state\":\"NOT_CREATED\"},{\"branch\":\"8.16\",\"label\":\"v8.16.5\",\"branchLabelMappingKey\":\"^v(\\\\d+).(\\\\d+).\\\\d+$\",\"isSourceBranch\":false,\"state\":\"NOT_CREATED\"}]}]\nBACKPORT-->\n\nCo-authored-by:
Quynh Nguyen (Quinn)
<[email protected]>"}},{"branch":"8.18","label":"v8.18.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v9.1.0","branchLabelMappingKey":"^v9.1.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/210217","number":210217,"mergeCommit":{"message":"[Fleet]
Fix unattended Transforms in integration packages not automatically
restarting after reauthorizing (#210217)\n\n## Summary\n\nThis PR
partially addresses an issue
with\nhttps://github.com/elastic/integrations/issues/12486 where the
transform\ndoesn't \"restart\" immediately after reauthorizing. This is
because for\nunattended transform, calling `_start` will come back with
409 transform\nalready started error. So this PR tracks if the transform
has\n`settings.unattended: true`, if yes, stop the transform first
before\nstarting.\n\nWithout this step, the transform will retry again
and become healthy\nagain anyway but it takes longer for that retry to
happen, so this PR\nspeeds up the process of retrying.\n\n\n###
Checklist\n\nCheck the PR satisfies following conditions. \n\nReviewers
should verify this PR satisfies this list as well.\n\n- [ ] Any text
added follows [EUI's
writing\nguidelines](https://elastic.github.io/eui/#/guidelines/writing),
uses\nsentence case text and includes
[i18n\nsupport](https://github.com/elastic/kibana/blob/main/src/platform/packages/shared/kbn-i18n/README.md)\n-
[
]\n[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)\nwas
added for features that require explanation or tutorials\n- [ ] [Unit or
functional\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\nwere
updated or added to match the most common scenarios\n- [ ] If a plugin
configuration key changed, check if it needs to be\nallowlisted in the
cloud and added to the
[docker\nlist](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker)\n-
[ ] This was checked for breaking HTTP API changes, and any
breaking\nchanges have been approved by the breaking-change committee.
The\n`release_note:breaking` label should be applied in these
situations.\n- [ ] [Flaky
Test\nRunner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1)
was\nused on any tests changed\n- [ ] The PR description includes the
appropriate Release Notes section,\nand the correct `release_note:*`
label is applied per
the\n[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)\n\n###
Identify risks\n\nDoes this PR introduce any risks? For example,
consider risks like hard\nto test bugs, performance regression,
potential of data loss.\n\nDescribe the risk, its severity, and
mitigation for each identified\nrisk. Invite stakeholders and evaluate
how to proceed before merging.\n\n- [ ] [See some
risk\nexamples](https://github.com/elastic/kibana/blob/main/RISK_MATRIX.mdx)\n-
[ ] ...\n\n---------\n\nCo-authored-by: Elastic Machine
<[email protected]>","sha":"e710f09d0c1159a9018ff6b9dfbac151509213f9"}},{"branch":"8.x","label":"v8.19.0","branchLabelMappingKey":"^v8.19.0$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.17","label":"v8.17.3","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.16","label":"v8.16.5","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->

---------

Co-authored-by: Elastic Machine <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:version Backport to applied version labels :ml release_note:fix Team:Fleet Team label for Observability Data Collection Fleet team v8.16.5 v8.17.3 v8.18.0 v8.19.0 v9.0.0 v9.1.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants