Skip to content

Properly cleanup SQLite persistence artifacts#97

Merged
viralpraxis merged 2 commits intopalkan:masterfrom
viralpraxis:properly-cleanup-sqlite-persistence-artifacts
Nov 7, 2025
Merged

Properly cleanup SQLite persistence artifacts#97
viralpraxis merged 2 commits intopalkan:masterfrom
viralpraxis:properly-cleanup-sqlite-persistence-artifacts

Conversation

@viralpraxis
Copy link
Collaborator

CI errors are reproducible locally:

$ env POSTGRES_URL=postgres://postgres:postgres@localhost:5432 DB=postgres BUNDLE_GEMFILE=gemfiles/rails8.gemfile bundle exec rspec

<snip>/lib/active_record/connection_adapters/sqlite3/database_statements.rb:105:in 'SQLite3::Statement#step': SQLite3::IOException: disk I/O error (ActiveRecord::StatementInvalid)
	from <snip>/lib/active_record/connection_adapters/sqlite3/database_statements.rb:105:in 'ActiveRecord::ConnectionAdapters::SQLite3::DatabaseStatements#perform_query'
	from <snip>/lib/active_record/connection_adapters/abstract/database_statements.rb:571:in 'block (2 levels) in ActiveRecord::ConnectionAdapters::DatabaseStatements#raw_execute'
	from <snip>/lib/active_record/connection_adapters/abstract_adapter.rb:1081:in 'block in ActiveRecord::ConnectionAdapters::AbstractAdapter#with_raw_connection'
	from /home/viralpraxis/.asdf/installs/ruby/3.4.7/lib/ruby/gems/3.4.0/gems/activesupport-8.1.1/lib/active_support/concurrency/null_lock.rb:9:in 'ActiveSupport::Concurrency::NullLock#synchronize'
	from <snip>/lib/active_record/connection_adapters/abstract_adapter.rb:1050:in 'ActiveRecord::ConnectionAdapters::AbstractAdapter#with_raw_connection'
	from <snip>/lib/active_record/connection_adapters/abstract/database_statements.rb:570:in 'block in ActiveRecord::ConnectionAdapters::DatabaseStatements#raw_execute'

I have no idea what changed on the SQLite's side but seems like we have to cleanup WAL and shared-memory files:

$ ls tmp
testdb2  testdb2-shm  testdb2-wal
$ sqlite3 --version
3.51.0 2025-11-04 19:38:17 fb2c931ae597f8d00a37574ff67aeed3eced4e5547f9120744a-experimental (64-bit)

@viralpraxis viralpraxis self-assigned this Nov 7, 2025
@viralpraxis viralpraxis force-pushed the properly-cleanup-sqlite-persistence-artifacts branch from 5ac0d06 to 09d8e59 Compare November 7, 2025 14:54
CI errors are reproducible locally:

```bash
$ env POSTGRES_URL=postgres://postgres:postgres@localhost:5432 DB=postgres BUNDLE_GEMFILE=gemfiles/rails8.gemfile bundle exec rspec

<snip>/lib/active_record/connection_adapters/sqlite3/database_statements.rb:105:in 'SQLite3::Statement#step': SQLite3::IOException: disk I/O error (ActiveRecord::StatementInvalid)
	from <snip>/lib/active_record/connection_adapters/sqlite3/database_statements.rb:105:in 'ActiveRecord::ConnectionAdapters::SQLite3::DatabaseStatements#perform_query'
	from <snip>/lib/active_record/connection_adapters/abstract/database_statements.rb:571:in 'block (2 levels) in ActiveRecord::ConnectionAdapters::DatabaseStatements#raw_execute'
	from <snip>/lib/active_record/connection_adapters/abstract_adapter.rb:1081:in 'block in ActiveRecord::ConnectionAdapters::AbstractAdapter#with_raw_connection'
	from /home/viralpraxis/.asdf/installs/ruby/3.4.7/lib/ruby/gems/3.4.0/gems/activesupport-8.1.1/lib/active_support/concurrency/null_lock.rb:9:in 'ActiveSupport::Concurrency::NullLock#synchronize'
	from <snip>/lib/active_record/connection_adapters/abstract_adapter.rb:1050:in 'ActiveRecord::ConnectionAdapters::AbstractAdapter#with_raw_connection'
	from <snip>/lib/active_record/connection_adapters/abstract/database_statements.rb:570:in 'block in ActiveRecord::ConnectionAdapters::DatabaseStatements#raw_execute'
```

I have no idea what changed on the SQLite's side but seems like we have to cleanup WAL and shared-memory files:

```shell
$ ls tmp
testdb2  testdb2-shm  testdb2-wal
```

```shell
$ sqlite3 --version
3.51.0 2025-11-04 19:38:17 fb2c931ae597f8d00a37574ff67aeed3eced4e5547f9120744a-experimental (64-bit)
```
@viralpraxis viralpraxis force-pushed the properly-cleanup-sqlite-persistence-artifacts branch from 09d8e59 to 0cc5f32 Compare November 7, 2025 14:59
@viralpraxis viralpraxis merged commit fe52f57 into palkan:master Nov 7, 2025
11 checks passed
@viralpraxis viralpraxis deleted the properly-cleanup-sqlite-persistence-artifacts branch November 7, 2025 15:24
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.

1 participant