mirror of
https://github.com/basecamp/once-campfire.git
synced 2026-10-10 00:30:13 +09:00
Stop WAL checkpointer before fork; one thread owns the flock
Unify startup: initializer starts every non-test process, Puma and Resque stop before fork and start again in the child. Only the contender thread releases the lock. Drop Puma::CLI / single_puma_process? special cases. Co-authored-by: Thomas Klemm <github@tklemm.eu>
This commit is contained in:
@@ -35,15 +35,6 @@ class SqliteWalCheckpointTest < ActiveSupport::TestCase
|
||||
assert_empty checkpoint_threads
|
||||
end
|
||||
|
||||
test "single_puma_process? treats only literal zero as single-process" do
|
||||
assert SqliteWalCheckpoint.single_puma_process?(0)
|
||||
assert SqliteWalCheckpoint.single_puma_process?("0")
|
||||
assert_not SqliteWalCheckpoint.single_puma_process?("auto")
|
||||
assert_not SqliteWalCheckpoint.single_puma_process?(2)
|
||||
assert_not SqliteWalCheckpoint.single_puma_process?("2")
|
||||
assert_not SqliteWalCheckpoint.single_puma_process?(8)
|
||||
end
|
||||
|
||||
test "tick checkpoints through the elected lock holder" do
|
||||
db_path = build_wal_database(rows: 50)
|
||||
SqliteWalCheckpoint.database_path_override = db_path
|
||||
|
||||
Reference in New Issue
Block a user