Skip to content

Conversation

@mheon
Copy link
Member

@mheon mheon commented Nov 7, 2017

Still not wired into the rest of the project

Copy link
Member

Choose a reason for hiding this comment

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

logrus.Wrapf

Copy link
Member 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 there is such a function?

Copy link
Member

Choose a reason for hiding this comment

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

I was thinking about this.

func (c *Container) Create() (err error) {

But you already have it, so all set.

Copy link
Member

Choose a reason for hiding this comment

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

I belive you need to pass in err

defer func() err error

Copy link
Member Author

Choose a reason for hiding this comment

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

Not necessary - the error returned by Create() is named err, so this will always be the error returned by the function

Copy link
Member

Choose a reason for hiding this comment

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

I agree.

Copy link
Member

Choose a reason for hiding this comment

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

Do we need these lines?

Copy link
Member Author

Choose a reason for hiding this comment

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

This is cleanup - it ensures the state knows the container is unmounted

Copy link
Member

Choose a reason for hiding this comment

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

Put on single line.

if err := s.db.Close()

@rhatdan
Copy link
Member

rhatdan commented Nov 7, 2017

@nalind @mitrmac ptal

@rhatdan
Copy link
Member

rhatdan commented Nov 7, 2017

@mheon Please cleanup gofmt and lint errors.

@mheon
Copy link
Member Author

mheon commented Nov 9, 2017

Wired the SQL backed state into the rest of libpod. Still needs unit tests.

@mheon
Copy link
Member Author

mheon commented Nov 9, 2017

Tests are segfaulting. Looks like a combination of errors (initializing the SQL-backed state is erroring, and then the deferred function to clean up the store on an error is segfaulting. I really don't understand how that segfault is happening, but I'll try and dig into this.

@mheon mheon force-pushed the sql_state branch 3 times, most recently from 854e011 to f676180 Compare November 9, 2017 20:53
@mheon
Copy link
Member Author

mheon commented Nov 9, 2017

Tests should be passing now. @rhatdan @baude PTAL. Still needs unit tests to be ready to merge, but otherwise should be fine.

Copy link
Member

Choose a reason for hiding this comment

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

I agree.

Copy link
Member

Choose a reason for hiding this comment

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

nit: remove line.

Copy link
Member

Choose a reason for hiding this comment

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

Why not defer it?

Copy link
Member

Choose a reason for hiding this comment

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

Don't you need to use err error for defer func below?

Copy link
Member

Choose a reason for hiding this comment

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

Nit: Can you do this in a single line?

if _, err2 := store.Shutdwon(false); err2 != nil

Copy link
Member

Choose a reason for hiding this comment

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

Should this be c.pod?

Copy link
Member Author

Choose a reason for hiding this comment

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

c is probably going to be nil when this is called, because we always return nil, err when an error occurs. If I could, I wouldn't have a variable assigned to the container we return at all, only the error, but I think Go won't let me do that.

Copy link
Member

Choose a reason for hiding this comment

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

Ok I guess this works, as long as this function is always called after ctr is created. I don't think go should require you to name the variable, or does it do this, because if you name one return you have to name them all?

Copy link
Member

@TomSweeneyRedHat TomSweeneyRedHat left a comment

Choose a reason for hiding this comment

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

LGTM. I would like to see this one go in at least a week or more before then next release. I'd like to see us run with it internally quite a bit before it gets put into an official kit. I'd also like Sebastian to run a perf run before making a kit too.

Nice chunk of work @mheon.

@rhatdan
Copy link
Member

rhatdan commented Nov 11, 2017

Well Sebastion has not tested perf on kpod at all yet, and I am pretty sure it would be really bad. :^(
If we wanted to test this for performance we would need to rig it into CRI-O to see if it hurt its performance.

@rhatdan rhatdan requested review from baude and nalind November 11, 2017 12:10
@rhatdan
Copy link
Member

rhatdan commented Nov 11, 2017

@baude @nalind PTAL

@TomSweeneyRedHat
Copy link
Member

@rhatdan, I'd thought kpd was being used in some of the calls that Sebastian was doing. If not, then yeah, no need to tie him in.

@rh-atomic-bot
Copy link
Collaborator

☔ The latest upstream changes (presumably #47) made this pull request unmergeable. Please resolve the merge conflicts.

@rhatdan
Copy link
Member

rhatdan commented Nov 15, 2017

@mheon Rebase.

Signed-off-by: Matthew Heon <[email protected]>
This one cleans up after container creation fails

Signed-off-by: Matthew Heon <[email protected]>
If StopSignal is 0, it is assumed that the default signal will be used.

Signed-off-by: Matthew Heon <[email protected]>
Signed-off-by: Matthew Heon <[email protected]>
@mheon mheon changed the title [WIP] Compile-tested implementation of SQL-backed state Implementation of SQL-backed state Nov 20, 2017
@mheon
Copy link
Member Author

mheon commented Nov 20, 2017

Tests can land in another PR. @rhatdan this should be ready to merge.

@rhatdan
Copy link
Member

rhatdan commented Nov 20, 2017

Ok lets merge and we can start testing as we merge components in.

@rhatdan rhatdan merged commit 6e0944f into containers:master Nov 20, 2017
wking added a commit to wking/libpod that referenced this pull request May 11, 2018
vendor.conf has been pinned at containerd/cgroups@7a5fdd83 (Merge pull
request containers#26 from onorua/error-ignore-example, 2017-08-24) since libpod
forked from CRI-O with a031b83 (Initial checkin from CRI-O repo,
2017-11-01).  The content in vendor/github.com/containerd/cgroups was
bumped to containerd/cgroups@77e62851 (Use /proc/diskstats to get
device names, 2018-01-31) in ae89dc2 (Update containerd/cgroups repo
fix perf issue, 2018-02-01, containers#284), but ae89dc2 forgot to update
vendor.conf.  With this commit:

  $ vndr github.com/containerd/cgroups

no longer changes anything under vendor/github.com/containerd/cgroups.

Signed-off-by: W. Trevor King <[email protected]>
rh-atomic-bot pushed a commit that referenced this pull request May 11, 2018
vendor.conf has been pinned at containerd/cgroups@7a5fdd83 (Merge pull
request #26 from onorua/error-ignore-example, 2017-08-24) since libpod
forked from CRI-O with a031b83 (Initial checkin from CRI-O repo,
2017-11-01).  The content in vendor/github.com/containerd/cgroups was
bumped to containerd/cgroups@77e62851 (Use /proc/diskstats to get
device names, 2018-01-31) in ae89dc2 (Update containerd/cgroups repo
fix perf issue, 2018-02-01, #284), but ae89dc2 forgot to update
vendor.conf.  With this commit:

  $ vndr github.com/containerd/cgroups

no longer changes anything under vendor/github.com/containerd/cgroups.

Signed-off-by: W. Trevor King <[email protected]>

Closes: #749
Approved by: mheon
openshift-merge-robot pushed a commit that referenced this pull request Nov 26, 2019
@github-actions github-actions bot added the locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. label Sep 28, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 28, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants