Skip to content

fix: [AAP-46563] solve potential race condition issue when disabling activations #1324

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

Merged
merged 2 commits into from
Jun 4, 2025

Conversation

hsong-rh
Copy link
Contributor

@hsong-rh hsong-rh commented Jun 2, 2025

Move the status update from API to Activation workers to avoid race conditions in activation disabling.

https://issues.redhat.com/browse/AAP-46563

@hsong-rh hsong-rh requested a review from a team as a code owner June 2, 2025 20:23
@hsong-rh hsong-rh force-pushed the aap-46563 branch 3 times, most recently from 418052a to d401448 Compare June 2, 2025 20:29
@codecov-commenter
Copy link

codecov-commenter commented Jun 2, 2025

Codecov Report

Attention: Patch coverage is 92.85714% with 1 line in your changes missing coverage. Please review.

Project coverage is 94.11%. Comparing base (50b0bbf) to head (276567f).

Files with missing lines Patch % Lines
src/aap_eda/api/views/activation.py 50.00% 1 Missing ⚠️
@@            Coverage Diff             @@
##             main    #1324      +/-   ##
==========================================
- Coverage   94.11%   94.11%   -0.01%     
==========================================
  Files         318      318              
  Lines       18651    18662      +11     
==========================================
+ Hits        17554    17564      +10     
- Misses       1097     1098       +1     
Flag Coverage Δ
unit-int-tests-3.11 94.05% <92.85%> (-0.01%) ⬇️
unit-int-tests-3.12 94.11% <92.85%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
.../aap_eda/services/activation/activation_manager.py 63.25% <ø> (-0.15%) ⬇️
...ts/integration/services/activation/test_manager.py 99.15% <100.00%> (+0.02%) ⬆️
src/aap_eda/api/views/activation.py 97.15% <50.00%> (-0.47%) ⬇️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Collaborator

@Alex-Izquierdo Alex-Izquierdo left a comment

Choose a reason for hiding this comment

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

IMO, is_enabled should not be domain of the activation_manager because it is a property of the activation as template, not part of the lifecycle of the activation. is_enabled triggers the stop operation, that's all.

Without reading it in deep, this change seems a stronger change and it might be the cause of the failed e2e tests.

I think the fix is much more simpler and It is what I understood it would be from our previous conversation. In the view we set activation.status = ActivationStatus.STOPPING only when the activation is already running (starting or running status). No need of migrations or changing the manager/orchestrator which already has the right logic.

@hsong-rh hsong-rh force-pushed the aap-46563 branch 6 times, most recently from 4e480ba to fbb66c2 Compare June 3, 2025 19:50
@hsong-rh hsong-rh force-pushed the aap-46563 branch 2 times, most recently from 5059d94 to bd3c1eb Compare June 4, 2025 15:29
Copy link

sonarqubecloud bot commented Jun 4, 2025

@hsong-rh hsong-rh merged commit b008cff into ansible:main Jun 4, 2025
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants