Skip to content

rados: Make sure Conn isn't GC'd while it has dependant IOContexts.#713

Merged
mergify[bot] merged 1 commit intoceph:masterfrom
baergj:fix-conn-early-gc
Jul 1, 2022
Merged

rados: Make sure Conn isn't GC'd while it has dependant IOContexts.#713
mergify[bot] merged 1 commit intoceph:masterfrom
baergj:fix-conn-early-gc

Conversation

@baergj
Copy link

@baergj baergj commented Jun 21, 2022

Because we have a finalizer configured for Conn that cleans up Ceph resources, it's important that we don't let it get GC'd before anything that depends on it has been cleaned up. Since clients are free to hold a reference to an IOContext without maintaining a reference to the underlying Conn, we hold such a Conn reference within the IOContext to signal this dependency to the Go GC.

Fixes #569.

@phlogistonjohn
Copy link
Collaborator

You are speedy. See my comments on #569 and #662. @ansiwen and I will need to resume the discussion on this topic once he's available.

That said the patch itself looks OK to me.

@phlogistonjohn
Copy link
Collaborator

After catching up on the other thread, I am largely in favor of just taking this change. It's simple, it's a very small delta between go-ceph as it is today, and it will fix issues people actually run into. It may not be the most rigorous option but I think it's the most practical. However, I won't approve it yet until I see buy in on this PR itself, as I don't want automerge to kick in just yet.

@ansiwen
Copy link
Collaborator

ansiwen commented Jun 30, 2022

I'm fine with merging this as is, because it's definitely an improvement to the current situation. But I would like to still have a conscious decision regarding the finalizer. I think it might bring us into the wrong direction.

ansiwen
ansiwen previously approved these changes Jun 30, 2022
@baergj baergj force-pushed the fix-conn-early-gc branch from be646ae to 677088c Compare June 30, 2022 12:39
@mergify mergify bot dismissed ansiwen’s stale review June 30, 2022 12:39

Pull request has been modified.

@baergj
Copy link
Author

baergj commented Jun 30, 2022

I've brought the PR up to date with master - looks like I'll need re-approvals.

ansiwen
ansiwen previously approved these changes Jun 30, 2022
@baergj baergj force-pushed the fix-conn-early-gc branch from 677088c to 8775237 Compare June 30, 2022 13:04
@mergify mergify bot dismissed ansiwen’s stale review June 30, 2022 13:04

Pull request has been modified.

@ansiwen
Copy link
Collaborator

ansiwen commented Jun 30, 2022

@baergj no need to force-push the rebased versions, else mergify will always remove the approvals. We need to use mergify for the rebase, as long as there are no merge conflicts.

@baergj
Copy link
Author

baergj commented Jun 30, 2022

@ansiwen Good to know! Sorry, I haven't used mergify before.

@baergj
Copy link
Author

baergj commented Jun 30, 2022

Hmm, I'm not seeing what failed in the Quincy tests (it just indicates that the rados tests failed, but not which one or why). Do either of you know how it failed?

@phlogistonjohn
Copy link
Collaborator

The mysterious, test stdout looks like a pass but job failed flake. Sorry, the other flakes seem to have causes but that one is unknown still. Regardless, I've restarted the job. It's unlikely to be related to the change.

@baergj
Copy link
Author

baergj commented Jul 1, 2022

Looks like this is ready to merge - do you need anything more from my side?

@phlogistonjohn
Copy link
Collaborator

@Mergifyio rebase

Because we have a finalizer configured for Conn that cleans up Ceph
resources, it's important that we don't let it get GC'd before anything
that depends on it has been cleaned up. Since clients are free to hold a
reference to an IOContext without maintaining a reference to the
underlying Conn, we hold such a Conn reference within the IOContext to
signal this dependency to the Go GC.

Signed-off-by: Joshua Baergen <jbaergen@digitalocean.com>
@mergify
Copy link

mergify bot commented Jul 1, 2022

rebase

✅ Branch has been successfully rebased

@ktdreyer ktdreyer force-pushed the fix-conn-early-gc branch from 8775237 to cfba1d9 Compare July 1, 2022 14:48
@phlogistonjohn
Copy link
Collaborator

@baergj we should be good thanks! The mergify system just needs to see all merge criteria met at least once to add it to the merge queue. So it needs another rebase - after that I think it will accept it.

@phlogistonjohn phlogistonjohn added the no-API This PR does not include any changes to the public API of a go-ceph package label Jul 1, 2022
@mergify mergify bot merged commit 9e340d1 into ceph:master Jul 1, 2022
@phlogistonjohn
Copy link
Collaborator

sigh it would help if I remember to put one of the required labels on :-)

@baergj
Copy link
Author

baergj commented Jul 1, 2022

Thanks all!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

no-API This PR does not include any changes to the public API of a go-ceph package

Projects

None yet

Development

Successfully merging this pull request may close these issues.

crash when call read on rados object

4 participants