Skip to content

kvserver: use type-safe atomics in raftSendQueue#88800

Merged
craig[bot] merged 1 commit intocockroachdb:masterfrom
pav-kv:atomic_todone
Sep 27, 2022
Merged

kvserver: use type-safe atomics in raftSendQueue#88800
craig[bot] merged 1 commit intocockroachdb:masterfrom
pav-kv:atomic_todone

Conversation

@pav-kv
Copy link
Copy Markdown
Collaborator

@pav-kv pav-kv commented Sep 27, 2022

Go 1.19 introduced atomic types that enforce atomic access to variables, which in many situation is less error-prone. This commit resolves a TODO to take advantage of these types.

Release note: None

Go 1.19 introduced atomic types that enforce atomic access to variables, which
in many situation is less error-prone. This commit resolves a TODO to take
advantage of these types.

Release note: None
@pav-kv pav-kv requested a review from a team as a code owner September 27, 2022 12:13
@cockroach-teamcity
Copy link
Copy Markdown
Member

This change is Reviewable

Copy link
Copy Markdown
Contributor

@nvb nvb left a comment

Choose a reason for hiding this comment

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

In #88506, I mentioned to @arulajmani that leaving our go directive in go.mod set to 1.17 should have prevented use of the new atomic stdlib additions from compiling. I think I misunderstood the go directive. It prevents use of new language features (e.g. generics), but not of library additions (e.g. atomic.Int64).

So this LGTM.

@pav-kv
Copy link
Copy Markdown
Collaborator Author

pav-kv commented Sep 27, 2022

In #88506, I mentioned to @arulajmani that leaving our go directive in go.mod set to 1.17 should have prevented use of the new atomic stdlib additions from compiling. I think I misunderstood the go directive. It prevents use of new language features (e.g. generics), but not of library additions (e.g. atomic.Int64).

So this LGTM.

Huh, my previous knowledge of this directive is: it just instructs which go.mod syntax/features to use, but apparently it's more nuanced than that.

@pav-kv
Copy link
Copy Markdown
Collaborator Author

pav-kv commented Sep 27, 2022

bors r=nvanbenschoten

@craig
Copy link
Copy Markdown
Contributor

craig bot commented Sep 27, 2022

Build failed (retrying...):

@pav-kv
Copy link
Copy Markdown
Collaborator Author

pav-kv commented Sep 27, 2022

bors retry

@craig
Copy link
Copy Markdown
Contributor

craig bot commented Sep 27, 2022

Already running a review

@craig
Copy link
Copy Markdown
Contributor

craig bot commented Sep 27, 2022

Build succeeded:

@craig craig bot merged commit 03b8afb into cockroachdb:master Sep 27, 2022
@pav-kv pav-kv deleted the atomic_todone branch September 27, 2022 16:40
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.

3 participants