Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

fix(coderd/cryptokeys): relock mutex to avoid double unlock#16802

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
mafredri merged 2 commits intomainfrommafredri/fix-coderd-cryptokeys-unlock
Mar 4, 2025

Conversation

mafredri
Copy link
Member

@mafredrimafredri requested review fromspikecurtis andsreya and removed request forspikecurtisMarch 4, 2025 16:16
@@ -255,6 +255,7 @@ func (c *cache) cryptoKey(ctx context.Context, sequence int32) (string, []byte,

keys, err := c.cryptoKeys(ctx)
if err != nil {
c.mu.Lock() // Re-lock because of defer.
Copy link
Contributor

Choose a reason for hiding this comment

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

I think it's clearer to move the Lock call from L262 up like:

c.mu.Unlock()keys, err := c.cryptoKeys(ctx)c.mu.Lock()if err != nil {    return "", nil, xerrors.Errorf("get keys: %w", err)}

That way it's clear that we are unlocking just for thec.cryptoKeys() call.

mafredri and sreya reacted with thumbs up emoji
@mafredrimafredrienabled auto-merge (squash)March 4, 2025 17:00
@mafredrimafredri merged commit6dd71b1 intomainMar 4, 2025
30 checks passed
@mafredrimafredri deleted the mafredri/fix-coderd-cryptokeys-unlock branchMarch 4, 2025 17:10
@github-actionsgithub-actionsbot locked and limited conversation to collaboratorsMar 4, 2025
Sign up for freeto subscribe to this conversation on GitHub. Already have an account?Sign in.
Reviewers

@sreyasreyasreya approved these changes

@spikecurtisspikecurtisspikecurtis approved these changes

Assignees

@mafredrimafredri

Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

3 participants
@mafredri@sreya@spikecurtis

[8]ページ先頭

©2009-2025 Movatter.jp