From 5987cd070b80a0e14905359149af6baeacd3d310 Mon Sep 17 00:00:00 2001 From: Siri Hansen Date: Mon, 18 Nov 2013 11:45:13 +0100 Subject: [common_test] Don't hang netconf client when close-session times out When the netconf server did not respond to the close-session request, the call to ct_netconfc:close_session/2 would hang forever waiting for the netconf client to terminate. This has been corrected. The client will now always terminate (and take down the connection) if the close-session request times out. --- lib/common_test/src/ct_netconfc.erl | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'lib/common_test/src/ct_netconfc.erl') diff --git a/lib/common_test/src/ct_netconfc.erl b/lib/common_test/src/ct_netconfc.erl index 7f10e1db09..64fe8b4bb0 100644 --- a/lib/common_test/src/ct_netconfc.erl +++ b/lib/common_test/src/ct_netconfc.erl @@ -1129,10 +1129,14 @@ handle_msg({Ref,timeout}, ct_gen_conn:return(Caller,{error,{hello_session_failed,timeout}}), {stop,State#state{hello_status={error,timeout}}}; handle_msg({Ref,timeout},#state{pending=Pending} = State) -> - {value,#pending{caller=Caller},Pending1} = + {value,#pending{op=Op,caller=Caller},Pending1} = lists:keytake(Ref,#pending.ref,Pending), ct_gen_conn:return(Caller,{error,timeout}), - {noreply,State#state{pending=Pending1}}. + R = case Op of + close_session -> stop; + _ -> noreply + end, + {R,State#state{pending=Pending1}}. %% @private %% Called by ct_util_server to close registered connections before terminate. -- cgit v1.2.3