Skip to content

Commit 23aa624

Browse files
committed
content-sqlite: unregister on error
Problem: if content-sqlite encounters a fatal error, it may not unregister itself from the content cache in the broker before exiting the module thread. Fix the control flow so the backing store is always unregistered on failure.
1 parent fe3b799 commit 23aa624

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/modules/content-sqlite/content-sqlite.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -832,16 +832,16 @@ int mod_main (flux_t *h, int argc, char **argv)
832832
if (content_register_backing_store (h, "content-sqlite") < 0)
833833
goto done;
834834
if (content_register_service (h, "content-backing") < 0)
835-
goto done;
835+
goto done_unreg;
836836
if (content_register_service (h, "kvs-checkpoint") < 0)
837-
goto done;
837+
goto done_unreg;
838838
if (flux_reactor_run (flux_get_reactor (h), 0) < 0) {
839839
flux_log_error (h, "flux_reactor_run");
840-
goto done;
840+
goto done_unreg;
841841
}
842-
if (content_unregister_backing_store (h) < 0)
843-
goto done;
844842
rc = 0;
843+
done_unreg:
844+
(void)content_unregister_backing_store (h);
845845
done:
846846
content_sqlite_closedb (ctx);
847847
content_sqlite_destroy (ctx);

0 commit comments

Comments
 (0)