Skip to content

Conversation

@mtrmac
Copy link
Collaborator

@mtrmac mtrmac commented Nov 26, 2024

... and use defer to avoid that bug in the future.

(Split from larger work as an independent piece. Reviewing is easier when ignoring whitespace changes.)

@mtrmac mtrmac added the kind/bug A defect in an existing functionality (or a PR fixing it) label Nov 26, 2024
if uncompressedDigest := options.Cache.UncompressedDigestForTOC(out.TOCDigest); uncompressedDigest != "" {
s.lockProtected.indexToDiffID[options.LayerIndex] = uncompressedDigest
if err := func() error { // A scope for defer
s.lock.Unlock()
Copy link
Contributor

Choose a reason for hiding this comment

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

Shouldn't this have a defer?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Oh wow, that’s embarrassing. 🤦

Thanks!

... and use defer to avoid that bug in the future.

Signed-off-by: Miloslav Trmač <[email protected]>
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.

LGTM

@vrothberg vrothberg merged commit 1a28c1b into containers:main Nov 28, 2024
10 checks passed
@mtrmac mtrmac deleted the unlock branch November 28, 2024 18:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind/bug A defect in an existing functionality (or a PR fixing it)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants