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

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

Closed
wants to merge 1 commit into from

Conversation

mtrmac
Copy link
Collaborator

@mtrmac mtrmac commented Sep 14, 2022

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.

Copy link
Member

@vrothberg vrothberg left a comment

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
Copy link
Collaborator Author

mtrmac commented Sep 15, 2022

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
Copy link
Collaborator Author

mtrmac commented Sep 15, 2022

  • 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
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
Copy link
Member

nalind commented Sep 28, 2022

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č <mitr@redhat.com>
@mtrmac mtrmac changed the title Deprecate lockfile.Locker.RecursiveLock Deprecate lockfile.Locker.RecursiveLock (alternative to #1376) Sep 30, 2022
@mtrmac
Copy link
Collaborator Author

mtrmac commented Sep 30, 2022

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
Copy link
Member

rhatdan commented Oct 1, 2022

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 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.

None yet

4 participants