LiteFS GET request containing writes + LiteFS with multiple processes

Changing

#!/bin/sh

# Start all processes in the Procfile (including worker)
# Poller will figure out whether or not to kill/restart the worker process based on the LiteFS events ("isPrimary" field)
echo "Starting all Procfile processes..."
overmind start -f deployments/Procfile

to

#!/bin/sh

# Start all processes in the Procfile (including worker)
# Poller will figure out whether or not to kill/restart the worker process based on the LiteFS events ("isPrimary" field)
echo "Starting all Procfile processes..."
exec overmind start -f deployments/Procfile # Add 'exec'

Was the missing piece. Now it looks like

14:13:59Z app[*e68] ams [info] INFO Sending signal SIGINT to main child process w/ PID 313
14:13:59Z app[*e68] ams [info]sending signal to exec process
14:13:59Z app[*e68] ams [info]waiting for exec process to close
14:13:59Z app[*e68] ams [info]backend | Interrupting...
14:13:59Z app[*e68] ams [info]worker  | Interrupting...
14:13:59Z app[*e68] ams [info]poller  | Interrupting...
14:13:59Z app[*e68] ams [info]backend | Received SIGINT, closing express server...
14:13:59Z app[*e68] ams [info]worker  | Received SIGINT, closing worker...
14:13:59Z app[*e68] ams [info]poller  | Shutting down...
14:14:00Z app[*e68] ams [info]poller  | Exited with code 0
14:14:00Z app[*e68] ams [info]worker  | Exited with code 0
14:14:00Z app[*e68] ams [info]backend | Exited with code 0
14:14:01Z app[*e68] ams [info]signal received, litefs shutting down
14:14:01Z app[*e68] ams [info]level=INFO msg="**: stream disconnected ([fdaa:5:a6f6:a7b:42:a729:cecb:2]:42644)"
14:14:01Z app[*e68] ams [info]level=INFO msg="exiting streaming backup"
14:14:01Z app[*e68] ams [info]level=INFO msg="begin streaming backup" full-sync-interval=10s
14:14:01Z app[*e68] ams [info]level=INFO msg="exiting streaming backup"
14:14:01Z app[*e68] ams [info]level=INFO msg="backup stream failed, retrying: fetch position map: Get \"https://litefs.fly.io/pos\": lease expired"
14:14:01Z app[*e68] ams [info]level=INFO msg="primary backup stream exiting"
14:14:01Z app[*e68] ams [info]level=INFO msg="**: exiting primary, destroying lease"
14:14:01Z app[*018] ams [info]level=INFO msg="**: disconnected from primary, retrying"
14:14:01Z app[*018] ams [info]poller  | New LiteFS event: {"type":"primaryChange","data":{"isPrimary":false}}
14:14:01Z app[*018] ams [info]poller  | isPrimary is false, stopping worker
14:14:01Z app[*e68] ams [info]litefs shut down complete
14:14:02Z app[*e68] ams [info] INFO Main child exited normally with code: 0
14:14:02Z app[*e68] ams [info] INFO Starting clean up.
14:14:02Z app[*e68] ams [info] INFO Umounting /dev/vdb from /var/lib/litefs
14:14:02Z app[*e68] ams [info][   92.448468] reboot: Restarting system
14:14:02Z app[*018] ams [info]level=INFO msg="**: primary lease acquired, advertising as http://*018.vm.service.internal:20202"
14:14:02Z app[*018] ams [info]level=INFO msg="begin primary backup stream: url=https://litefs.fly.io"
14:14:02Z app[*018] ams [info]poller  | New LiteFS event: {"type":"primaryChange","data":{"isPrimary":true}}
14:14:02Z app[*018] ams [info]poller  | isPrimary is true, restarting worker
14:14:02Z app[*018] ams [info]worker  | Restarting...
14:14:02Z app[*018] ams [info]worker  | Restarted with pid 478...

I thought child processes automatically received and relayed stop signals…

1 Like