Duplicate trust core created on fork failure
Twice now the following sequence of events has happened:
- Our ubuntu 18.04 server experiences pthread starvation leading to lockup:
runtime/cgo: pthread_create failed: Resource temporarily unavailable
SIGABRT: abort
- We restart the server
- cron.hourly/monkeysphere starts failing:
/etc/cron.hourly/monkeysphere:
monkeysphere-authentication gave up after 6 tries
The proximate cause is that monkeysphere has created a duplicate trust core. ma/setup assumes that only one exists, and fails with error 2 on finding an unexpected newline in the output of $(core_fingerprint)
. The quick fix is to purge and reinstall monkeysphere.
I suspect this is due to missing error handling, which fails to catch a (transient) fork failure and treats it as a nonexistent trust core; it then attempts to create a new one automatically and sometimes is lucky enough to succeed...