Skip to content

Commit

Permalink
Merge pull request xapi-project#13 from robhoes/master
Browse files Browse the repository at this point in the history
CA-112572: networkd: protect IP watcher thread with an exception handler
  • Loading branch information
Jon Ludlam committed Jul 30, 2013
2 parents 0cde8e9 + abf9b51 commit 4aed922
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions networkd/network_monitor_thread.ml
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,6 @@ let ip_watcher () =
);
Unix.close writeme;
let in_channel = Unix.in_channel_of_descr readme in
debug "Started IP watcher thread";
let rec loop () =
let line = input_line in_channel in
(* Do not send events for link-local IPv6 addresses, and removed IPs *)
Expand All @@ -279,7 +278,13 @@ let ip_watcher () =
end;
loop ()
in
loop ()
while true do
try
info "(Re)started IP watcher thread";
loop ()
with e ->
warn "Error in IP watcher: %s\n%s" (Printexc.to_string e) (Printexc.get_backtrace ())
done

let start () =
let dbg = "monitor_thread" in
Expand Down

0 comments on commit 4aed922

Please sign in to comment.