-
Notifications
You must be signed in to change notification settings - Fork 440
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
Use OnceLock instead of manually implementing it #4805
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks like it simplified the code a bit! nice.
1240 tests run: 1186 passed, 0 failed, 54 skipped (full report)Flaky tests (7)Postgres 15
Postgres 14
|
45cbe4c
to
9ffd552
Compare
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking very good.
Yeah, in the future we might have to switch some to Personally I'm also good with consistently using |
Your call. I was hopeful of us no longer needing to use |
@koivunej yeah it will be years until the ecosystem switches off once_cell, even if the standard library catches up. I think it's best to not do the change for now, it's easy to do later in the future. We gain consistency and if someone does a refactor that requires a fallible init, they don't have to switch to |
Problem
In #4743 , I'm trying to make more of the pageserver async, but in order for that to happen, I need to be able to persist the result of
ImageLayer::load
across await points. For that to happen, the return value needs to beSend
.Summary of changes
Use
OnceLock
in the image layer instead of manually implementing it with booleans, locks andOption
.Part of #4743
Checklist before requesting a review
Checklist before merging