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

Container exit code not persisted properly #986

Closed
samuelkarp opened this issue Sep 20, 2017 · 2 comments
Closed

Container exit code not persisted properly #986

samuelkarp opened this issue Sep 20, 2017 · 2 comments
Assignees
Labels
Milestone

Comments

@samuelkarp
Copy link
Contributor

Summary

It looks like the container exit code may not be properly persisted in the agent's state file, leading to data loss potentially impacting the call to submit state changes to ECS.

Description

Container data is stored in an api.Container struct, which is then serialized to JSON and stored in a file. During agent restarts, this file is read and the api.Container structs are rebuilt based on the serialized data. With Go's default JSON marshaling library (encoding/json), only visible fields (public) are serialized. In fee2053, KnownExitCode was changed to knownExitCode which resulted in the field being a non-visible, private field.

Expected Behavior

Exit code should be serialized and saved in the agent state file.

Observed Behavior

Exit code is not present in the agent state file.

@ofiliz ofiliz self-assigned this Oct 18, 2017
@ofiliz
Copy link
Contributor

ofiliz commented Dec 1, 2017

Fixing knownExitCode is fine, but then there is all that other state in Container that is exposed only because we need it marshaled. Should we just write a custom JSON marshaler instead and make all that "*unsafe" state private?

@samuelkarp
Copy link
Contributor Author

Yes, I think that would likely be a better approach.

@ofiliz ofiliz closed this as completed Dec 4, 2017
@aaithal aaithal added this to the 1.17.0 milestone Dec 13, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants