diff options
author | Adam Kocoloski <kocolosk@apache.org> | 2019-05-20 11:36:47 -0400 |
---|---|---|
committer | Adam Kocoloski <kocolosk@apache.org> | 2019-05-21 10:35:16 -0400 |
commit | 80e3cd8111bda643686d9165ea6afa99d0d33cd4 (patch) | |
tree | cc881d8c3e3539a797b614ca4a14d8438fbd9d99 | |
parent | 45469b9c9d1d3188c2d22e0c8306ac461ec64094 (diff) | |
download | couchdb-80e3cd8111bda643686d9165ea6afa99d0d33cd4.tar.gz |
Address EPI's startup use of dreyfus_config
This is a lazy workaround to address a tricky interdependency in the
application startup order. Dreyfus depends on the config application,
but the plugin engine makes a call to dreyfus_config:data(), which
relies on the config app, before the dreyfus app -- or the config app --
is started. The couch_epi module does not add a dependency on config so
if couch_epi happens to start before config the whole VM can crash.
The dreyfus_epi module configures the plugin interface to re-load the
configuration data once a second, so ignoring the failure on startup
only leaves a window of up to one second where any custom blacklist
configuration for the dreyfus app is not loaded.
-rw-r--r-- | src/dreyfus_config.erl | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/dreyfus_config.erl b/src/dreyfus_config.erl index 8dbd62430..b7555c1d0 100644 --- a/src/dreyfus_config.erl +++ b/src/dreyfus_config.erl @@ -3,7 +3,12 @@ -export([data/0, get/1]). data() -> - config:get("dreyfus_blacklist"). + try + config:get("dreyfus_blacklist") + catch error:badarg -> + % lazy workaround to address issue with epi invocation on startup + [] + end. get(Key) -> Handle = couch_epi:get_handle({dreyfus, black_list}), |