Start a trial
Color

Stopping and restarting the server safely

What the server does when you stop it, how long it waits for work in progress, and why you can stop it for an update without losing anything.

For
OwnerAdministrator
Hosting
Office serverYour own hostingHosted plan
Devices
Server
Business
All businesses

Checked against Pop Dispatch 0.1.0

You can stop the server for an update or a move whenever you need to. It finishes what it is doing first. You will be able to restart with nothing lost.

Before you start #

Tell the people in the office a minute ahead, so they save what they are typing. Phones and desktops keep working from their own copy and send their changes when the server is back.

Steps #

  1. Stop the server: close it in its command window with Ctrl+C, stop the Pop Dispatch service, or stop it from your hosting panel.
  2. The server stops taking new connections at once.
  3. It lets requests that are running finish, up to 25 seconds.
  4. It sends the webhook deliveries that are due and saves the license clock.
  5. It folds the database log into the database file and exits. The log line reads "stopped".
  6. Start it again. It opens the database and carries on. Deliveries that were not due yet go out at their time.

What stays safe if the stop is rough #

A power cut or a forced stop skips steps 3 to 5. Nothing committed is lost: every save is all or nothing, a delivery that was sent but not confirmed goes out once more after a short wait, and the next start checks the database before it opens. See "Safe mode, crashes and the Restored your last session bar".

Technical details
  • PSD_STOP_GRACE_SECS sets the wait for running requests (1 to 600, default 25). A request still running after that is cut off and the server logs a warning.
  • The outbox step has a 10 second limit. Deliveries still waiting stay in the database.
  • The Windows service honors the same steps when the service manager sends a stop.

If something goes wrong #

  • The server takes longer than expected to stop: a long upload or export is finishing. Wait, or raise the limit and stop again.
  • The log shows "some requests were still running": those requests were cut off, and the person who sent them sees an error and retries.