Skip to content
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

db_sqlite: new parameters for SQLite configuration #3559

Merged
merged 5 commits into from
Jan 16, 2025

Conversation

vasilevalex
Copy link
Contributor

Summary

  • Add new parameters to the module to configure the behavior of the database
  • Use recommended by SQLite documentation way of processing locked state

Details
New parameters allowing tuning of SQLite database

Solution
Please review commits

Compatibility
The original behavior has been changed. If the database is locked, the process attempting to access it will no longer enter an infinite loop. Instead, it will return an error after the default timeout of 500 ms (this value can be modified as module parameter).

sqlite3_db_config with SQLITE_DBCONFIG_ENABLE_LOAD_EXTENSION affects
only C-API without enabling SQL function load_extension()
The proper way to handle a locked database is to use a busy timeout.
Previously, the behavior resulted in an infinite lock for the process
attempting to write to the locked database. The default value for the
busy timeout has been set to 500 ms to avoid immediate errors when short
database locks occur.
@bogdan-iancu bogdan-iancu merged commit 7192510 into OpenSIPS:master Jan 16, 2025
43 of 49 checks passed
@bogdan-iancu bogdan-iancu self-assigned this Jan 16, 2025
@bogdan-iancu bogdan-iancu added this to the 3.6-dev milestone Jan 16, 2025
@bogdan-iancu
Copy link
Member

Thank you @vasilevalex

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants