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

call shutdown in LifecycleNode dtor to avoid leaving the device in un… #2450

Merged
merged 2 commits into from
Apr 6, 2024

Conversation

fujitatomoya
Copy link
Collaborator

…known state.

address #997

…known state.

Signed-off-by: Tomoya Fujita <Tomoya.Fujita@sony.com>
@fujitatomoya
Copy link
Collaborator Author

@Barry-Xu-2018 @alsora could you take a look as 1st review?

@fujitatomoya fujitatomoya self-assigned this Mar 18, 2024
@Barry-Xu-2018
Copy link
Collaborator

Barry-Xu-2018 commented Mar 19, 2024

I agree with adding tests for destructing LifecycleNode under different states of lifecycle node. However, the code added in this PR indeed is difficult to check by tests.

Maybe we should register a callback function (register_on_shutdown) in the tests to confirm that the state transitions to 'Finalized' when LifecycleNode is destructed.

Signed-off-by: Tomoya Fujita <Tomoya.Fujita@sony.com>
@fujitatomoya fujitatomoya requested a review from alsora April 5, 2024 20:57
@fujitatomoya
Copy link
Collaborator Author

@alsora requesting another review! thanks in advance.

@alsora
Copy link
Collaborator

alsora commented Apr 5, 2024

  • Linux Build Status
  • Linux-aarch64 Build Status
  • Windows Build Status

@alsora
Copy link
Collaborator

alsora commented Apr 6, 2024

Running Linux CI again.
The previous failure seems unrelated.

  • Linux Build Status

@fujitatomoya fujitatomoya merged commit 04ea0bb into rolling Apr 6, 2024
3 checks passed
@delete-merged-branch delete-merged-branch bot deleted the fujitatomoya/issue-997 branch April 6, 2024 23:42
@fujitatomoya
Copy link
Collaborator Author

@Mergifyio backport iron humble

Copy link
Contributor

mergify bot commented Apr 6, 2024

backport iron humble

✅ Backports have been created

mergify bot pushed a commit that referenced this pull request Apr 6, 2024
#2450)

* call shutdown in LifecycleNode dtor to avoid leaving the device in unknown state.

Signed-off-by: Tomoya Fujita <Tomoya.Fujita@sony.com>

* add test to verify LifecycleNode::shutdown is called on destructor.

Signed-off-by: Tomoya Fujita <Tomoya.Fujita@sony.com>

---------

Signed-off-by: Tomoya Fujita <Tomoya.Fujita@sony.com>
(cherry picked from commit 04ea0bb)
mergify bot pushed a commit that referenced this pull request Apr 6, 2024
#2450)

* call shutdown in LifecycleNode dtor to avoid leaving the device in unknown state.

Signed-off-by: Tomoya Fujita <Tomoya.Fujita@sony.com>

* add test to verify LifecycleNode::shutdown is called on destructor.

Signed-off-by: Tomoya Fujita <Tomoya.Fujita@sony.com>

---------

Signed-off-by: Tomoya Fujita <Tomoya.Fujita@sony.com>
(cherry picked from commit 04ea0bb)
fujitatomoya added a commit that referenced this pull request Apr 7, 2024
#2450) (#2490)

* call shutdown in LifecycleNode dtor to avoid leaving the device in unknown state.

Signed-off-by: Tomoya Fujita <Tomoya.Fujita@sony.com>

* add test to verify LifecycleNode::shutdown is called on destructor.

Signed-off-by: Tomoya Fujita <Tomoya.Fujita@sony.com>

---------

Signed-off-by: Tomoya Fujita <Tomoya.Fujita@sony.com>
(cherry picked from commit 04ea0bb)

Co-authored-by: Tomoya Fujita <Tomoya.Fujita@sony.com>
fujitatomoya added a commit that referenced this pull request Apr 7, 2024
#2450) (#2491)

* call shutdown in LifecycleNode dtor to avoid leaving the device in unknown state.

Signed-off-by: Tomoya Fujita <Tomoya.Fujita@sony.com>

* add test to verify LifecycleNode::shutdown is called on destructor.

Signed-off-by: Tomoya Fujita <Tomoya.Fujita@sony.com>

---------

Signed-off-by: Tomoya Fujita <Tomoya.Fujita@sony.com>
(cherry picked from commit 04ea0bb)

Co-authored-by: Tomoya Fujita <Tomoya.Fujita@sony.com>
clalancette added a commit that referenced this pull request May 8, 2024
clalancette added a commit that referenced this pull request May 9, 2024
mergify bot pushed a commit that referenced this pull request May 9, 2024
…ce in un… (#2450)" (#2522)

This reverts commit 04ea0bb.

(cherry picked from commit 42b0b57)
clalancette added a commit that referenced this pull request May 9, 2024
…ce in un… (#2450)" (#2522) (#2524)

This reverts commit 04ea0bb.

(cherry picked from commit 42b0b57)

Co-authored-by: Chris Lalancette <clalancette@gmail.com>
fujitatomoya added a commit that referenced this pull request May 11, 2024
…the device in un… (#2450)" (#2522)"

This reverts commit 42b0b57.

Signed-off-by: Tomoya Fujita <Tomoya.Fujita@sony.com>
fujitatomoya added a commit that referenced this pull request May 24, 2024
…the device in un… (#2450)" (#2522)"

This reverts commit 42b0b57.

Signed-off-by: Tomoya Fujita <Tomoya.Fujita@sony.com>
fujitatomoya added a commit that referenced this pull request May 29, 2024
…known state (2nd) (#2528)

* Revert "Revert "call shutdown in LifecycleNode dtor to avoid leaving the device in un… (#2450)" (#2522)"

This reverts commit 42b0b57.

Signed-off-by: Tomoya Fujita <Tomoya.Fujita@sony.com>

* lifecycle node dtor shutdown should be called only in primary state.

Signed-off-by: Tomoya Fujita <Tomoya.Fujita@sony.com>

* adjust warning message if the node is still in transition state in dtor.

Signed-off-by: Tomoya Fujita <Tomoya.Fujita@sony.com>

---------

Signed-off-by: Tomoya Fujita <Tomoya.Fujita@sony.com>
mergify bot pushed a commit that referenced this pull request May 29, 2024
…known state (2nd) (#2528)

* Revert "Revert "call shutdown in LifecycleNode dtor to avoid leaving the device in un… (#2450)" (#2522)"

This reverts commit 42b0b57.

Signed-off-by: Tomoya Fujita <Tomoya.Fujita@sony.com>

* lifecycle node dtor shutdown should be called only in primary state.

Signed-off-by: Tomoya Fujita <Tomoya.Fujita@sony.com>

* adjust warning message if the node is still in transition state in dtor.

Signed-off-by: Tomoya Fujita <Tomoya.Fujita@sony.com>

---------

Signed-off-by: Tomoya Fujita <Tomoya.Fujita@sony.com>
(cherry picked from commit 3bc364a)
fujitatomoya added a commit that referenced this pull request Jun 7, 2024
…known state (2nd) (backport #2528) (#2542)

* call shutdown in LifecycleNode dtor to avoid leaving the device in unknown state (2nd) (#2528)

* Revert "Revert "call shutdown in LifecycleNode dtor to avoid leaving the device in un… (#2450)" (#2522)"

This reverts commit 42b0b57.

Signed-off-by: Tomoya Fujita <Tomoya.Fujita@sony.com>

* lifecycle node dtor shutdown should be called only in primary state.

Signed-off-by: Tomoya Fujita <Tomoya.Fujita@sony.com>

* adjust warning message if the node is still in transition state in dtor.

Signed-off-by: Tomoya Fujita <Tomoya.Fujita@sony.com>

---------

Signed-off-by: Tomoya Fujita <Tomoya.Fujita@sony.com>
(cherry picked from commit 3bc364a)

* LifecycleNode shutdown on dtor only with valid context. (#2545)

Signed-off-by: Tomoya Fujita <Tomoya.Fujita@sony.com>

---------

Signed-off-by: Tomoya Fujita <Tomoya.Fujita@sony.com>
Co-authored-by: Tomoya Fujita <Tomoya.Fujita@sony.com>
fujitatomoya added a commit that referenced this pull request Jun 10, 2024
…ce in un… (#2450) (#2490)"

This reverts commit f41a353.

Signed-off-by: Tomoya Fujita <Tomoya.Fujita@sony.com>
fujitatomoya added a commit that referenced this pull request Jun 10, 2024
…ce in un… (#2450) (#2491)"

This reverts commit 0f9604d.

Signed-off-by: Tomoya Fujita <Tomoya.Fujita@sony.com>
fujitatomoya added a commit that referenced this pull request Jun 11, 2024
* Revert "lifecycle node dtor shutdown should be called only in primary state. (#2543)"

This reverts commit dceb612.

Signed-off-by: Tomoya Fujita <Tomoya.Fujita@sony.com>

* Revert "call shutdown in LifecycleNode dtor to avoid leaving the device in un… (#2450) (#2490)"

This reverts commit f41a353.

Signed-off-by: Tomoya Fujita <Tomoya.Fujita@sony.com>

---------

Signed-off-by: Tomoya Fujita <Tomoya.Fujita@sony.com>
fujitatomoya added a commit that referenced this pull request Jun 12, 2024
* Revert "lifecycle node dtor shutdown should be called only in primary state. (#2544)"

This reverts commit 595badb.

Signed-off-by: Tomoya Fujita <Tomoya.Fujita@sony.com>

* Revert "call shutdown in LifecycleNode dtor to avoid leaving the device in un… (#2450) (#2491)"

This reverts commit 0f9604d.

Signed-off-by: Tomoya Fujita <Tomoya.Fujita@sony.com>

---------

Signed-off-by: Tomoya Fujita <Tomoya.Fujita@sony.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants