Skip to content

sql: clean up some uses of Unlock#107665

Merged
craig[bot] merged 1 commit intocockroachdb:masterfrom
RaduBerinde:safe-unlock
Jul 31, 2023
Merged

sql: clean up some uses of Unlock#107665
craig[bot] merged 1 commit intocockroachdb:masterfrom
RaduBerinde:safe-unlock

Conversation

@RaduBerinde
Copy link
Copy Markdown
Member

This is a minor cleanup change to use defer.Unlock when there are multiple exit paths that need to unlock.

Epic: none
Release note: None

@RaduBerinde RaduBerinde requested a review from a team as a code owner July 26, 2023 20:16
@RaduBerinde RaduBerinde requested a review from a team July 26, 2023 20:16
@RaduBerinde RaduBerinde requested review from a team as code owners July 26, 2023 20:16
@RaduBerinde RaduBerinde requested a review from a team July 26, 2023 20:16
@RaduBerinde RaduBerinde requested a review from a team as a code owner July 26, 2023 20:16
@RaduBerinde RaduBerinde requested review from smg260 and yuzefovich and removed request for a team July 26, 2023 20:16
@cockroach-teamcity
Copy link
Copy Markdown
Member

This change is Reviewable

Copy link
Copy Markdown
Contributor

@maryliag maryliag left a comment

Choose a reason for hiding this comment

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

Thank you fixing this! Would you mind also updating here (since is also under sql package)?

Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained (waiting on @Santamaura, @smg260, @srosenberg, and @yuzefovich)

Copy link
Copy Markdown
Member

@yuzefovich yuzefovich left a comment

Choose a reason for hiding this comment

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

Reviewed 7 of 7 files at r1, all commit messages.
Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained (waiting on @RaduBerinde, @Santamaura, @smg260, and @srosenberg)


pkg/sql/sqlliveness/slstorage/slstorage.go line 232 at r1 (raw file):

		// At this point, we know that the singleflight goroutine has been launched.
		// Releasing the lock here ensures that callers will either join the single-

nit: this comment might need an update given that we no longer release the lock right below.

Copy link
Copy Markdown
Member Author

@RaduBerinde RaduBerinde left a comment

Choose a reason for hiding this comment

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

Done

Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained (waiting on @Santamaura, @smg260, @srosenberg, and @yuzefovich)

Copy link
Copy Markdown
Contributor

@maryliag maryliag left a comment

Choose a reason for hiding this comment

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

I will leave for other teams to check their code, but for the ones under sql/sqlstats :lgtm:

Reviewed 6 of 7 files at r1, 2 of 2 files at r2, all commit messages.
Reviewable status: :shipit: complete! 1 of 0 LGTMs obtained (waiting on @Santamaura, @smg260, and @srosenberg)

Copy link
Copy Markdown
Member

@yuzefovich yuzefovich left a comment

Choose a reason for hiding this comment

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

:lgtm:

Reviewed 2 of 2 files at r2, all commit messages.
Reviewable status: :shipit: complete! 2 of 0 LGTMs obtained (waiting on @Santamaura, @smg260, and @srosenberg)

Copy link
Copy Markdown
Collaborator

@dhartunian dhartunian left a comment

Choose a reason for hiding this comment

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

tracer.go and histogram.go :lgtm: thank you!

Reviewed 2 of 7 files at r1.
Reviewable status: :shipit: complete! 3 of 0 LGTMs obtained (waiting on @Santamaura, @smg260, and @srosenberg)

Copy link
Copy Markdown
Member Author

@RaduBerinde RaduBerinde left a comment

Choose a reason for hiding this comment

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

TFTRs!

Essential CI failure is a flake that already has an issue filed.

bors r+

Reviewable status: :shipit: complete! 3 of 0 LGTMs obtained (waiting on @Santamaura, @smg260, and @srosenberg)

@craig
Copy link
Copy Markdown
Contributor

craig bot commented Jul 28, 2023

Build failed (retrying...):

@craig
Copy link
Copy Markdown
Contributor

craig bot commented Jul 28, 2023

This PR was included in a batch that timed out, it will be automatically retried

@craig
Copy link
Copy Markdown
Contributor

craig bot commented Jul 28, 2023

Build failed (retrying...):

@craig
Copy link
Copy Markdown
Contributor

craig bot commented Jul 28, 2023

Build failed:

This is a minor cleanup change to use `defer.Unlock` when there are
multiple exit paths that need to unlock.

Epic: none
Release note: None
@RaduBerinde
Copy link
Copy Markdown
Member Author

bors r+

@craig
Copy link
Copy Markdown
Contributor

craig bot commented Jul 31, 2023

Timed out.

@RaduBerinde
Copy link
Copy Markdown
Member Author

bors r+

@craig
Copy link
Copy Markdown
Contributor

craig bot commented Jul 31, 2023

Build succeeded:

@craig craig bot merged commit 37e61e9 into cockroachdb:master Jul 31, 2023
@RaduBerinde RaduBerinde deleted the safe-unlock branch November 7, 2025 15:11
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.

5 participants