Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions oxenstored/connection.ml
Original file line number Diff line number Diff line change
Expand Up @@ -193,13 +193,11 @@ let mark_as_bad con =
let initial_next_tid = 1

let do_reconnect con =
(* transactions and watches handled by caller *)
Xenbus.Xb.reconnect con.xb ;
(* dom is the same *)
Hashtbl.clear con.transactions ;
con.next_tid <- initial_next_tid ;
Hashtbl.clear con.watches ;
(* anonid is the same *)
con.nb_watches <- 0 ;
con.stat_nb_ops <- 0 ;
(* perm is the same *)
()
Expand Down
4 changes: 0 additions & 4 deletions oxenstored/history.ml
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,6 @@ let end_transaction txn con tid commit =
let success = Connection.end_transaction con tid commit in
trim ~txn () ; success

let reconnect con =
trim () ;
Connection.do_reconnect con

let push (x : history_record) =
let dom = x.con.Connection.dom in
match dom with
Expand Down
28 changes: 16 additions & 12 deletions oxenstored/process.ml
Original file line number Diff line number Diff line change
Expand Up @@ -472,10 +472,20 @@ let do_isintroduced con _t domains _cons data =
else
"F\000"

(* only in xen >= 4.2 *)
let do_reset_watches con _t _domains cons _data =
let reset_watches_and_transactions cons con =
Connections.del_watches cons con ;
Connection.del_transactions con
Connection.del_transactions con ;
History.trim ()

let do_reset_watches con _t _domains cons _data =
reset_watches_and_transactions cons con

let do_reconnect cons con =
let domstr = Connection.get_domstr con in
info "%s requests a reconnect" domstr ;
reset_watches_and_transactions cons con ;
Connection.do_reconnect con ;
info "%s reconnection complete" domstr

(* only in >= xen3.3 *)
let do_set_target con _t _domains cons data =
Expand Down Expand Up @@ -976,10 +986,7 @@ let do_input store cons doms con =
None
with
| Xenbus.Xb.Reconnect ->
info "%s requests a reconnect" (Connection.get_domstr con) ;
History.reconnect con ;
info "%s reconnection complete" (Connection.get_domstr con) ;
None
do_reconnect cons con ; None
| Invalid_argument exp | Failure exp ->
error "caught exception %s" exp ;
error "got a bad client %s" (sprintf "%-8s" (Connection.get_domstr con)) ;
Expand All @@ -1002,7 +1009,7 @@ let do_input store cons doms con =
write_access_log ~ty ~tid ~con:(Connection.get_domstr con) ~data ;
Connection.incr_ops con

let do_output _store _cons _doms con =
let do_output _store cons _doms con =
Connection.source_flush_watchevents con ;
if Connection.has_output con then (
( if Connection.has_new_output con then
Expand All @@ -1015,8 +1022,5 @@ let do_output _store _cons _doms con =
write_answer_log ~ty ~tid ~con:(Connection.get_domstr con) ~data
) ;
try ignore (Connection.do_output con)
with Xenbus.Xb.Reconnect ->
info "%s requests a reconnect" (Connection.get_domstr con) ;
History.reconnect con ;
info "%s reconnection complete" (Connection.get_domstr con)
with Xenbus.Xb.Reconnect -> do_reconnect cons con
)
Loading