-
Notifications
You must be signed in to change notification settings - Fork 1
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
Make sure to set max connection to 1 #45
Conversation
muhamadazmy
commented
Apr 8, 2024
•
edited
Loading
edited
- Fix issue with sqlite connection locking by making sure pool max number of connections is 1.
- This PR also fixes an issue with pack that it makes sure pack exits with an error if one or more files failed to upload
If one or more files fail to pack, the entire process will end up in an error in the end. It will also print out all failed files
db975e8
to
7b324e9
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.
i can confirm this work in my use-case of pack'ing a nixos rootfs to s3 on a machine with many cores.
please see the code readability suggestion i made as well.
thank you!
@@ -348,7 +348,10 @@ impl Writer { | |||
.journal_mode(SqliteJournalMode::Delete) | |||
.filename(path); | |||
|
|||
let pool = SqlitePool::connect_with(opts).await?; | |||
let pool = SqlitePoolOptions::new() | |||
.max_connections(1) |
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.
since there is already an explicit opts
variable it's slightly confusing to see this option added here instead of adding it to opts
.
let pool = SqlitePoolOptions::new() | ||
.max_connections(1) | ||
.connect_with(opts) | ||
.await?; |
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.
let pool = SqlitePoolOptions::new() | |
.max_connections(1) | |
.connect_with(opts) | |
.await?; | |
let pool = SqlitePool::connect_with(opts).await?; |
@@ -348,7 +348,10 @@ impl Writer { | |||
.journal_mode(SqliteJournalMode::Delete) |
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.
.journal_mode(SqliteJournalMode::Delete) | |
.journal_mode(SqliteJournalMode::Delete) | |
.max_connections(1) |
this introduces a single source of truth for the used rust toolchain