Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Using sqlite3, thousands of "database is locked" warnings in logs #2645

Closed
solracsf opened this issue Aug 30, 2022 Discussed in #2615 · 4 comments · Fixed by #3046
Closed

Using sqlite3, thousands of "database is locked" warnings in logs #2645

solracsf opened this issue Aug 30, 2022 Discussed in #2615 · 4 comments · Fixed by #3046
Assignees

Comments

@solracsf
Copy link
Contributor

solracsf commented Aug 30, 2022

Discussed in #2615

Originally posted by solracsf August 28, 2022
When using Litestream, there are some parameters that can be optimized : https://litestream.io/tips/

Is there any way to pass PRAGMA parameters? Could this be an enhancement?

This would avoid lines like:

juicefs[634272] <WARNING>: Transaction succeeded after 3 tries (3.671605ms), inodes: [1], last error: database is locked [sql.go:654]

See https://github.com/mattn/go-sqlite3/blob/master/README.md#connection-string
If this is already possible, document it.

@solracsf
Copy link
Contributor Author

solracsf commented Aug 30, 2022

I've tested a mount with

sqlite3://juicefs.db?_journal_mode=WAL&_busy_timeout=5000&_synchronous=NORMAL

and it seem to work flawlessly, PR at #2647.

But LOCK warnings still happening.

<WARNING>: Transaction succeeded after 3 tries (1.968603ms), inodes: [], last error: database is locked [sql.go:654]

@solracsf
Copy link
Contributor Author

Let me add this here that could help for a better handling of these:
mattn/go-sqlite3#632 (comment)

@solracsf solracsf changed the title Set PRAGMA when using sqlite3, avoiding thousands of "database is locked" warnings in logs Using sqlite3, thousands of "database is locked" warnings in logs Aug 31, 2022
@davies
Copy link
Contributor

davies commented Aug 31, 2022

Can you add -q to ignore these warning?

@solracsf
Copy link
Contributor Author

Why hide them instead of avoid them? 🥴

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants