Skip to content

Commit 4245225

Browse files
committed
CA-NNNNN: avoid calling DB functions when in emergency mode
This breaks emergency mode commands. Signed-off-by: Edwin Török <[email protected]>
1 parent 71f64c8 commit 4245225

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

ocaml/xapi/server_helpers.ml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,17 @@ let do_dispatch ?session_id ?forward_op ?self:_ supports_async called_fn_name
150150
in
151151
Tgroup.Group.Identity.make ?user_agent:http_req.user_agent subject
152152
)
153-
session_id
153+
( if
154+
!Xapi_globs.tgroups_enabled
155+
&& not !Xapi_globs.slave_emergency_mode
156+
then
157+
session_id
158+
else
159+
(* in emergency mode we cannot reach the coordinator,
160+
and we must not attempt to make Db calls
161+
*)
162+
None
163+
)
154164
with _ -> None
155165
in
156166
Tgroup.of_creator (Tgroup.Group.Creator.make ?identity ()) ;

0 commit comments

Comments
 (0)