Skip to content

[bug] race condition at controller action #817

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

Closed
gthao313 opened this issue May 3, 2023 · 0 comments · Fixed by #816
Closed

[bug] race condition at controller action #817

gthao313 opened this issue May 3, 2023 · 0 comments · Fixed by #816
Assignees

Comments

@gthao313
Copy link
Member

gthao313 commented May 3, 2023

Problem we found:

When we ran ecs migration test, it would fail on the following errors.

[2023-05-03T17:16:27Z TRACE controller::resource_controller] Action: Creation(Done)
[2023-05-03T17:16:30Z TRACE controller::test_controller::reconcile] action Error(TestError("Resource 'x86-64-aws-ecs-1-migration-test-cluster-instances' not found"))
[2023-05-03T17:16:30Z ERROR controller::test_controller::reconcile] Error state for test 'x86-64-aws-ecs-1-migration-test-cluster-test-2-migrate': Resource 'x86-64-aws-ecs-1-migration-test-cluster-instances' not found
[2023-05-03T17:16:30Z TRACE controller::test_controller::reconcile] action Error(TestError("Resource 'x86-64-aws-ecs-1-migration-test-cluster-instances' not found"))
[2023-05-03T17:16:30Z ERROR controller::test_controller::reconcile] Error state for test 'x86-64-aws-ecs-1-migration-test-cluster-test-2-migrate': Resource 'x86-64-aws-ecs-1-migration-test-cluster-instances' not found
[2023-05-03T17:16:30Z TRACE controller::test_controller::reconcile] action Error(TestError("Unknown error"))

Solution

The resources that the test depends on sometimes come out later. At this time, the controller will think that the resource has not been found and then raise error.

if result.is_status_code(StatusCode::NOT_FOUND) {

We should add a retry logic to keep finding the resources until exhaust all attempts to avoid "false" NOT FOUND

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant