gargoyle icon indicating copy to clipboard operation
gargoyle copied to clipboard

Error is shown when directory is deleted too quickly

Open ryantrinkle opened this issue 5 years ago • 1 comments

This:

test = withSystemTempDirectory "test" $ \dir -> do
  withDb (dir </> "db") $ \_ -> return ()

looks reasonable but causes scary-looking (but benign) output:

pg_ctl: directory "/run/user/1000/test-af26b0f35c589919/db/work" is not a database cluster directory
gargoyle-nix-postgres-monitor: /run/user/1000/test-af26b0f35c589919/db/control: removeLink: does not exist (No such file or directory)

It seems that withDb returns before gargoyle actually shuts down, and therefore withSystemDirectory deletes the postgres instance before pg_ctl has a chance to shut it down.

ryantrinkle avatar Apr 21 '19 03:04 ryantrinkle