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

[NEXMANAGE-737] Sota cancel mode with threading event method #567

Merged
merged 7 commits into from
Oct 18, 2024

Conversation

yengliong93
Copy link
Contributor

@yengliong93 yengliong93 commented Oct 9, 2024

PULL DESCRIPTION

This PR implements the sota cancel mode using a threading event flag. When the thread is created, it will be added to a thread list.
When the dispatcher receives the sota cancel request, it checks the current running thread and retrieves its sota type. If it is a download-only sota, the dispatcher sets the event flag to issue a cancel request.
Please note that the first inbc command should be terminated before sending inbc cancel command as they will be sharing the same mqtt connection.

Impact Analysis

Info Please fill out this column
Root Cause Specifically for bugs, empty in case of no variants
Jira ticket NEXMANAGE-737

CODE MAINTAINABILITY

  • Added required new tests relevant to the changes
  • Updated Documentation as relevant to the changes
  • PR change contains code related to security
  • PR introduces changes that break compatibility with other modules/services (If YES, please provide description)
  • Run go fmt or format-python.sh as applicable
  • Update Changelog
  • Integration tests are passing
  • If Cloudadapter changes, check Azure connectivity manually

Code must act as a teacher for future developers

@yengliong93
Copy link
Contributor Author

Hi @gblewis1, this PR contains the cancel mode with threading.event method. Unfortunately, it's not functioning as expected. More details are in #559 (comment). It seems like the self._cancel_event.set() doesn't reflect in the sub-thread.

@yengliong93 yengliong93 changed the title WIP: Sota cancel mode event method WIP: Sota cancel mode with threading event method Oct 9, 2024
@yengliong93 yengliong93 force-pushed the sota-cancel-mode-event-method branch from 622ac8f to 4010119 Compare October 10, 2024 02:35
@yengliong93
Copy link
Contributor Author

The threading event method is actually working. Previously, there was only one place to check the event.is_set. The SOTA process was running too quickly, bypassing that check. I have now added another check after self.calculate_and_execute_sota_upgrade(sota_cache_repo). As a result, I can now see the expected SOTA failure after the event is set.

@yengliong93 yengliong93 force-pushed the sota-cancel-mode-event-method branch from 147ba2e to bf8a9e1 Compare October 10, 2024 06:21
@yengliong93 yengliong93 changed the title WIP: Sota cancel mode with threading event method [NEXMANAGE-737] Sota cancel mode with threading event method Oct 10, 2024
@yengliong93 yengliong93 force-pushed the sota-cancel-mode-event-method branch from bf8a9e1 to baee1d8 Compare October 10, 2024 06:32
@yengliong93
Copy link
Contributor Author

@gblewis1 please have a review, thanks.

This PR implements the sota cancel mode using a threading event flag. When the thread is created, it will be added to a thread list.
When the dispatcher receives the sota cancel request, it checks the current running thread and retrieves its sota type. If it is a download-only sota, the dispatcher sets the event flag to issue a cancel request.
Please note that the first inbc command should be terminated before sending inbc cancel command as they will be sharing the same mqtt connection.

Signed-off-by: yengliong <[email protected]>
@yengliong93 yengliong93 force-pushed the sota-cancel-mode-event-method branch from 0476299 to f71e149 Compare October 16, 2024 00:16
@yengliong93 yengliong93 merged commit 5426e6c into develop Oct 18, 2024
15 checks passed
@yengliong93 yengliong93 deleted the sota-cancel-mode-event-method branch October 18, 2024 00:12
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.

2 participants