daml/ci
Gary Verhaegen 55776f92ba
clear shared memory segment on macOS (#6530)
For a while now we've had errors along the line of

```
FATAL:  could not create shared memory segment: No space left on device
DETAIL:  Failed system call was shmget(key=5432001, size=56, 03600).
HINT:  This error does *not* mean that you have run out of disk space.
It occurs either if all available shared memory IDs have been taken, in
which case you need to raise the SHMMNI parameter in your kernel, or
because the system's overall limit for shared memory has been reached.
        The PostgreSQL documentation contains more information about
shared memory configuration.
child process exited with exit code 1
```

on macOS CI nodes, which we were not able to reproduce locally. Today I
managed to, sort of by accident, and that allowed me to dig a bit
further.

The root cause seems to be that PostgreSQL, as run by Bazel, does not
always seem to properly unlink the shared memory segment it uses to
communicate with itself. On my machine, running:

```
bazel test -t- --runs_per_test=100 //ledger/sandbox:conformance-test-wall-clock-postgresql
```

and eyealling the results of

```
watch ipcs -mcopt
```

I would say about one in three runs leaks its memory segment. After much
googling and some head scratching trying to figure out the C APIs for
managing shared memory segments on macOS, I kind of stumbled on a
reference to `pcirm` in a comment to some low-ranking StackOverflow
answer. It looks like it's working very well on my machine, even if I
run it while a test (and therefore an instance of pg) is running. I
believe this is because the command does not actually remove the shared
memory segments, but simply marks them for removal once the last process
stops using it. (At least that's what the manpage describes.)

CHANGELOG_BEGIN
CHANGELOG_END
2020-06-30 01:40:16 +02:00
..
cron clear shared memory segment on macOS (#6530) 2020-06-30 01:40:16 +02:00
da-ghc-lib Update ghc-lib, da-ghc-master-8.8.1 (#6460) 2020-06-23 08:29:16 -04:00
docker/daml-sdk Add /etc/nsswitch.conf to our Dockerfile (#5882) 2020-05-07 09:44:44 +02:00
patch_bazel_windows Sort files when calculating CACHE_KEY (#6173) 2020-05-31 22:02:13 +02:00
build-unix.yml Use Sandbox Classic as DAML on SQL (#6095) 2020-05-27 08:31:27 +02:00
build-windows.yml trigger all releases from master (#6016) 2020-05-19 19:18:10 +02:00
check-changelog.sh enable patch releases (#5584) 2020-04-16 17:50:55 +02:00
compatibility_ts_libs.yml Include create-daml-app tests in compatibility tests (#5945) 2020-05-13 10:39:51 +02:00
compatibility-windows.yml Include create-daml-app tests in compatibility tests (#5945) 2020-05-13 10:39:51 +02:00
compatibility.yml Include create-daml-app tests in compatibility tests (#5945) 2020-05-13 10:39:51 +02:00
configure-bazel.sh Bump Windows cache (#6383) 2020-06-17 19:33:26 +02:00
daily_tell_slack.yml fix error message on daily compat failure (#6337) 2020-06-14 22:52:57 +02:00
dev-env-install.sh Fix nix installation (#6400) 2020-06-18 10:34:08 +02:00
dev-env-push.py replace DAML Authors with DA in copyright headers (#5228) 2020-03-27 01:26:10 +01:00
postgresql.conf CI: Run PostgreSQL once for all Scala tests. (#5919) 2020-05-14 09:06:34 +02:00
report-end.yml replace DAML Authors with DA in copyright headers (#5228) 2020-03-27 01:26:10 +01:00
report-start.yml replace DAML Authors with DA in copyright headers (#5228) 2020-03-27 01:26:10 +01:00
slack_user_ids Notify Sofia on #team-daml-ci (#5487) 2020-04-08 09:31:54 +00:00
tell-slack-failed.yml fix tell-slack-failed CI "function" (#5670) 2020-04-22 15:21:04 +02:00
windows-diagnostics.ps1 windows: CI agent diagnostics (#1146) 2019-05-15 11:59:56 +02:00