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 <[email protected]>
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),

Reply via email to