Skip to content
This repository was archived by the owner on Nov 19, 2026. It is now read-only.

Deprecate lockfile.Locker.RecursiveLock (alternative to #1376) - #1344

Closed
mtrmac wants to merge 1 commit into
containers:mainfrom
mtrmac:recursive-broken
Closed

mtrmac wants to merge 1 commit into
containers:mainfrom
mtrmac:recursive-broken

Conversation

@mtrmac

@mtrmac mtrmac commented Sep 14, 2022

Copy link
Copy Markdown
Collaborator

It is not valid as currently implemented, and there is no known user.

Cc: @vrothberg : This was added in #347 , supposedly for the concurrent copy detection.

@vrothberg vrothberg left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Why not fix it?

I didn't think it entirely through but assume we still need it for the concurrent pull work, don't we?

@mtrmac

mtrmac commented Sep 15, 2022

Copy link
Copy Markdown
Collaborator Author

Why not fix it?

Sure, in principle.

I don’t immediately know how to do that

  • Go does not provide a recursive locking primitive
  • It does not even provide a goroutine ID, which would be necessary for my first guess at how to build one ourselves
  • We need to somehow integrate that goroutine with non-recursive uses of the same locks — or maybe we don’t; what does the currently-nonexistent concurrent-pull implementation truly need?

… assume we still need it for the concurrent pull work, don't we?

I don’t know, I haven’t looked into that.


… and I can’t spend time on this for the next few weeks (months?) at least. In the meantime, I want the problem to be recorded and documented, to prevent accidents.

We can always un-deprecate this after the implementation is fixed.

@mtrmac

mtrmac commented Sep 15, 2022

Copy link
Copy Markdown
Collaborator Author
  • and we need tests to actually exercise the recursiveness of the locks, contention in recursive situations, and interaction with non-recursive read/write lock owners; IIRC the current ones don’t do (at least some of?) that.

@vrothberg

Copy link
Copy Markdown
Member

We can always un-deprecate this after the implementation is fixed.

Yes, that sounds like a good idea.

LGTM, @nalind are you on board?

@nalind

nalind commented Sep 28, 2022

Copy link
Copy Markdown
Member

It's fine, though the prospect of keeping an API around with known breakage is troubling. If it's only there for a WIP caller that hasn't been merged and isn't actively being worked on, I'm more inclined to just remove it outright and revisit it when it becomes relevant again.

It is not valid as currently implemented, and there is no known user.

Signed-off-by: Miloslav Trmač <[email protected]>
@mtrmac mtrmac changed the title Deprecate lockfile.Locker.RecursiveLock Deprecate lockfile.Locker.RecursiveLock (alternative to #1376) Sep 30, 2022
@mtrmac

mtrmac commented Sep 30, 2022

Copy link
Copy Markdown
Collaborator Author

I'm more inclined to just remove it outright

Sure: #1376 . I don’t have a strong preference.


(I have updated this one to deprecate also the callers in C/I/L stores; they seem to be public but can’t actually be directly accessed by external users anyway.)

@rhatdan

rhatdan commented Oct 1, 2022

Copy link
Copy Markdown
Member

Lets remove it.

@rhatdan rhatdan closed this Oct 1, 2022
@mtrmac
mtrmac deleted the recursive-broken branch October 1, 2022 17:41
vrothberg added a commit that referenced this pull request Oct 11, 2022
Remove lockfile.Locker.RecursiveLock (alternative to #1344)
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants