Skip to content

Commit 16f104b

Browse files
authored
CA-424916 don't exit thread/loop on events error (#6950)
In XSI-2169 an INVALID_VALUE exception leads to the restart of the events thread - without fixing anything. So don't re-raise the exception after logging it.
2 parents 481913f + 35b32d6 commit 16f104b

1 file changed

Lines changed: 6 additions & 8 deletions

File tree

ocaml/xapi/xapi_xenops.ml

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3446,19 +3446,17 @@ let events_from_xapi () =
34463446
if resident_here then
34473447
Xenopsd_metadata.update ~__context ~self:vm
34483448
|> ignore
3449-
with e ->
3450-
if not (Db.is_valid_ref __context vm) then
3449+
with
3450+
| e when not (Db.is_valid_ref __context vm) ->
34513451
debug
34523452
"VM %s has been removed: event on it will be \
3453-
ignored"
3454-
(Ref.string_of vm)
3455-
else (
3453+
ignored: %S"
3454+
(Ref.string_of vm) (Printexc.to_string e)
3455+
| e ->
34563456
error
34573457
"Caught %s while processing XenAPI event for VM \
34583458
%s"
3459-
(Printexc.to_string e) (Ref.string_of vm) ;
3460-
raise e
3461-
)
3459+
(Printexc.to_string e) (Ref.string_of vm)
34623460
)
34633461
| {ty= "host"; reference= t; _} when t = localhost' ->
34643462
debug

0 commit comments

Comments
 (0)