fix: unbreaks postgrest-profiled-run
* replaces v2-build -> v2-run (which should be v2-exec) with one-shot v2-run * fixes empty postgrest.prof file by sending SIGINT to the profiled postgrest process to trigger writing it explicitly
This commit is contained in:
committed by
Steve Chavez
parent
c08b87749b
commit
b7ad217cd3
@@ -95,9 +95,8 @@ let
|
|||||||
export PGRST_DB_POOL_ACQUISITION_TIMEOUT
|
export PGRST_DB_POOL_ACQUISITION_TIMEOUT
|
||||||
export PGRST_JWT_SECRET
|
export PGRST_JWT_SECRET
|
||||||
|
|
||||||
${cabal-install}/bin/cabal --builddir="dist-prof" v2-build --enable-profiling --disable-shared exe:postgrest
|
exec ${cabal-install}/bin/cabal --builddir="dist-prof" v2-run --enable-profiling --disable-shared exe:postgrest -- \
|
||||||
${cabal-install}/bin/cabal --builddir="dist-prof" v2-run -- \
|
+RTS -p -h -RTS "''${_arg_leftovers[@]}"
|
||||||
postgrest +RTS -p -h -RTS "''${_arg_leftovers[@]}"
|
|
||||||
'';
|
'';
|
||||||
|
|
||||||
repl =
|
repl =
|
||||||
|
|||||||
@@ -5,6 +5,7 @@
|
|||||||
, lib
|
, lib
|
||||||
, postgresqlVersions
|
, postgresqlVersions
|
||||||
, postgrest
|
, postgrest
|
||||||
|
, procps
|
||||||
, python3Packages
|
, python3Packages
|
||||||
, slocat
|
, slocat
|
||||||
, writeText
|
, writeText
|
||||||
@@ -373,6 +374,14 @@ let
|
|||||||
pid=$!
|
pid=$!
|
||||||
# shellcheck disable=SC2317
|
# shellcheck disable=SC2317
|
||||||
cleanup() {
|
cleanup() {
|
||||||
|
# Send INT to all postgrest processes.
|
||||||
|
# Workaround to trigger dumping postgrest.prof for postgrest-profiled-run
|
||||||
|
# Caveat: we cannot realistically limit this to the current process' tree,
|
||||||
|
# since pkill's --parent supports only direct children; therefore this
|
||||||
|
# would reap neighbor postgrest instances as well, because INT is asking
|
||||||
|
# the process to terminate too.
|
||||||
|
# TODO: consider cgroups to make this cleaner
|
||||||
|
${procps}/bin/pkill --echo --signal=INT --exact postgrest
|
||||||
kill "$pid" || true
|
kill "$pid" || true
|
||||||
}
|
}
|
||||||
trap cleanup EXIT
|
trap cleanup EXIT
|
||||||
|
|||||||
Reference in New Issue
Block a user