You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by va...@apache.org on 2025/03/03 23:35:52 UTC
(couchdb) branch config-cleanup created (now 4da3f831b)
This is an automated email from the ASF dual-hosted git repository.
vatamane pushed a change to branch config-cleanup
in repository https://gitbox.apache.org/repos/asf/couchdb.git
at 4da3f831b Make sure terminate/2 is called in config
This branch includes the following new commits:
new 4da3f831b Make sure terminate/2 is called in config
The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
(couchdb) 01/01: Make sure terminate/2 is called in config
Posted by va...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
vatamane pushed a commit to branch config-cleanup
in repository https://gitbox.apache.org/repos/asf/couchdb.git
commit 4da3f831bde95521d07eb79518a1ae76ffea0ebd
Author: Nick Vatamaniuc <va...@gmail.com>
AuthorDate: Mon Mar 3 18:30:48 2025 -0500
Make sure terminate/2 is called in config
The callback was not called as we didn't trap exits. This is not a big deal at
runtime, as the process would go down anyway after config app terminates, and
even if it restarts, we'd clean up all the config values anyway in init.
However, when running tests this could leave config value set from the previous
config app run.
---
src/config/src/config.erl | 2 ++
1 file changed, 2 insertions(+)
diff --git a/src/config/src/config.erl b/src/config/src/config.erl
index a94483943..bf8358d1d 100644
--- a/src/config/src/config.erl
+++ b/src/config/src/config.erl
@@ -276,6 +276,8 @@ subscribe_for_changes(Subscription) ->
config_notifier:subscribe(Subscription).
init(IniFilesDirs) ->
+ % trap exits to make sure terminate/2 gets called
+ process_flag(trap_exit, true),
enable_early_features(),
erase_all(),
IniFiles = expand_dirs(IniFilesDirs),