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

engine: adding poll function during progressTask #1876

Merged

Conversation

petderek
Copy link
Contributor

@petderek petderek commented Feb 21, 2019

Summary

This ensures that SUCCESS and HEALTHY conditions are reachable
when progressTask sees no activity.

Implementation details

Prior to this commit, we only tracked state we explicitly tried to
change when the task was starting. We did not respond to the event
stream or any other source of information from Docker. This means
that when we are waiting for certain dependency conditions
("SUCCESS", "COMPLETE", or "HEALTHY") the task progression logic
does not update the agent-internal model of container state.

Since we rely on that state for determining when conditions are
met, tasks would get stuck in infinite startup loops. This change
adds a call to engine.checkTaskState(), which explicity updates
any changed container state. We only call this function if we know
that we are waiting on the aforementioned subset of dependency
conditions.

Testing

We manually tested use cases involving "success" and "healthy".

Integ tests are on the way.

New tests cover the changes: WIP, will be added to this PR or another one depending on how lengthly they get.

Description for the changelog

Licensing

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@petderek petderek requested review from ubhattacharjya and a team February 21, 2019 20:16
}

for _, dependency := range target.DependsOn {
dependencyContainer, ok := existingContainers[dependency.Container]
if !ok {
return fmt.Errorf("dependency graph: container ordering dependency [%v] for target [%v] does not exist.", dependencyContainer, target)
return nil,fmt.Errorf("dependency graph: container ordering dependency [%v] for target [%v] does not exist.", dependencyContainer, target)
Copy link
Contributor

Choose a reason for hiding this comment

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

Not sure but do you want to return the &dependency in here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I don't think so, since this function is only validating that its possible to resolve.

Copy link
Contributor

@adnxn adnxn left a comment

Choose a reason for hiding this comment

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

changes lgtm

@petderek petderek force-pushed the container-ordering-task-sync branch from 85397fb to 22391c5 Compare February 22, 2019 01:40
Prior to this commit, we only tracked state we explicitly tried to
change when the task was starting. We did not respond to the event
stream or any other source of information from Docker. This means
that when we are waiting for certain dependency conditions
("SUCCESS", "COMPLETE", or "HEALTHY") the task progression logic
does not update the agent-internal model of container state.

Since we rely on that state for determining when conditions are
met, tasks would get stuck in infinite startup loops. This change
adds a call to engine.checkTaskState(), which explicity updates
any changed container state. We only call this function if we know
that we are waiting on the aforementioned subset of dependency
conditions.

Co-authored-by: Utsa Bhattacharjya <[email protected]>
@petderek petderek force-pushed the container-ordering-task-sync branch from 22391c5 to 4c57056 Compare February 22, 2019 01:47
@petderek
Copy link
Contributor Author

Merging this, will do integ tests on a different PR before we merge this to dev

@petderek petderek merged commit 3bc095b into aws:container-ordering-feature Feb 22, 2019
@ellenthsu ellenthsu added this to the 1.26.0 milestone Feb 27, 2019
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.

5 participants