Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@muhamadazmy
Copy link
Member

@muhamadazmy muhamadazmy commented Apr 8, 2024

  • 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
Copy link
Contributor

@steveej steveej left a 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!


let pool = SqlitePool::connect_with(opts).await?;
let pool = SqlitePoolOptions::new()
.max_connections(1)
Copy link
Contributor

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.

Comment on lines +351 to +354
let pool = SqlitePoolOptions::new()
.max_connections(1)
.connect_with(opts)
.await?;
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
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)
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
.journal_mode(SqliteJournalMode::Delete)
.journal_mode(SqliteJournalMode::Delete)
.max_connections(1)

this introduces a single source of truth for the used rust toolchain
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