Skip to content

Commit

Permalink
compat: fix killing stale sandbox(es) (#9003)
Browse files Browse the repository at this point in the history
We've seen this happen once; I don't think it's worth investigating.

CHANGELOG_BEGIN
CHANGELOG_END
  • Loading branch information
garyverhaegen-da committed Mar 3, 2021
1 parent 32dc8b0 commit 259bf68
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions compatibility/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,11 @@ cp ../.bazelrc .bazelrc
# but it happens sufficiently rarely that just killing it here is
# a cheaper solution than having to reset the node.
# Note that lsof returns a non-zero exit code if there is no match.
SANDBOX_PID="$(lsof -ti tcp:6865 || true)"
if [ -n "$SANDBOX_PID" ]; then
kill "$SANDBOX_PID"
fi
## Even more rarely we end up with 2 pids returned by lsof, so we account for
## that with a for loop.
for pid in $(lsof -ti tcp:6865); do
kill $pid
done

# Set up a shared PostgreSQL instance. This is the same code as in //:build.sh.
export POSTGRESQL_ROOT_DIR="${TMPDIR:-/tmp}/daml/postgresql"
Expand Down

0 comments on commit 259bf68

Please sign in to comment.