[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#771940: marked as done ((pre-approval) unblock: ejabberd/14.07-4)



Your message dated Thu, 4 Dec 2014 09:27:24 +0100
with message-id <20141204082724.GC7395@ugent.be>
and subject line Re: Bug#771940: (pre-approval) unblock: ejabberd/14.07-4
has caused the Debian Bug report #771940,
regarding (pre-approval) unblock: ejabberd/14.07-4
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact owner@bugs.debian.org
immediately.)


-- 
771940: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=771940
Debian Bug Tracking System
Contact owner@bugs.debian.org with problems
--- Begin Message ---
Package: release.debian.org
Severity: normal
User: release.debian.org@packages.debian.org
Usertags: unblock

Please unblock package ejabberd

I would like to upload a new revision on the weekend,
fixing an important bug: #711808

The patch for this is attached.
No other changes (except changelog) intended.

unblock ejabberd/14.07-4
commit d04a500b6cb878aeffa687ce8ae284b386bca62e
Author: Holger Weiss <holger@zedat.fu-berlin.de>
Date:   Tue Dec 2 17:39:38 2014 +0100

    Avoid hanging c2s processes

diff --git a/debian/patches/avoid_hanging_c2s.patch b/debian/patches/avoid_hanging_c2s.patch
new file mode 100644
index 0000000..5c16015
--- /dev/null
+++ b/debian/patches/avoid_hanging_c2s.patch
@@ -0,0 +1,77 @@
+Description: avoid hanging c2s processes
+ When Stream Management is enabled for a client session and a
+ gen_tcp:send/2 call fails, make sure that gen_tcp:send/2 won't be
+ called again. This avoids an Erlang issue where gen_tcp:send/2 blocks
+ despite 'send_timeout' (and 'send_timeout_close') being set. The patch
+ has been applied upstream after the 14.07 release.
+Author: Holger Weiss <holger@zedat.fu-berlin.de>
+
+diff --git a/src/ejabberd_c2s.erl b/src/ejabberd_c2s.erl
+index 1e07be8..2b0f05e 100644
+--- a/src/ejabberd_c2s.erl
++++ b/src/ejabberd_c2s.erl
+@@ -1167,9 +1167,7 @@ session_established({xmlstreamerror, _}, StateData) ->
+     send_element(StateData, ?INVALID_XML_ERR),
+     send_trailer(StateData),
+     {stop, normal, StateData};
+-session_established(closed, StateData)
+-    when StateData#state.mgmt_timeout > 0,
+-	 StateData#state.mgmt_state == active ->
++session_established(closed, #state{mgmt_state = active} = StateData) ->
+     fsm_next_state(wait_for_resume, StateData);
+ session_established(closed, StateData) ->
+     {stop, normal, StateData}.
+@@ -1653,8 +1651,7 @@ handle_info({route, From, To,
+ handle_info({'DOWN', Monitor, _Type, _Object, _Info},
+ 	    _StateName, StateData)
+     when Monitor == StateData#state.socket_monitor ->
+-    if StateData#state.mgmt_timeout > 0,
+-       StateData#state.mgmt_state == active orelse
++    if StateData#state.mgmt_state == active;
+        StateData#state.mgmt_state == pending ->
+ 	   fsm_next_state(wait_for_resume, StateData);
+        true ->
+@@ -1812,7 +1809,8 @@ send_text(StateData, Text) when StateData#state.mgmt_state == active ->
+     ?DEBUG("Send XML on stream = ~p", [Text]),
+     case catch (StateData#state.sockmod):send(StateData#state.socket, Text) of
+       {'EXIT', _} ->
+-	  (StateData#state.sockmod):close(StateData#state.socket);
++	  (StateData#state.sockmod):close(StateData#state.socket),
++	  error;
+       _ ->
+ 	  ok
+     end;
+@@ -1831,8 +1829,13 @@ send_element(StateData, El) ->
+ send_stanza(StateData, Stanza) when StateData#state.mgmt_state == pending ->
+     mgmt_queue_add(StateData, Stanza);
+ send_stanza(StateData, Stanza) when StateData#state.mgmt_state == active ->
+-    send_stanza_and_ack_req(StateData, Stanza),
+-    mgmt_queue_add(StateData, Stanza);
++    NewStateData = case send_stanza_and_ack_req(StateData, Stanza) of
++		     ok ->
++			 StateData;
++		     error ->
++			 StateData#state{mgmt_state = pending}
++		   end,
++    mgmt_queue_add(NewStateData, Stanza);
+ send_stanza(StateData, Stanza) ->
+     send_element(StateData, Stanza),
+     StateData.
+@@ -2429,11 +2432,15 @@ fsm_next_state_gc(StateName, PackedStateData) ->
+ 
+ %% fsm_next_state: Generate the next_state FSM tuple with different
+ %% timeout, depending on the future state
++fsm_next_state(session_established, #state{mgmt_state = pending} = StateData) ->
++    fsm_next_state(wait_for_resume, StateData);
+ fsm_next_state(session_established, StateData) ->
+     {next_state, session_established, StateData,
+      ?C2S_HIBERNATE_TIMEOUT};
+-fsm_next_state(wait_for_resume, StateData)
+-    when StateData#state.mgmt_state /= pending ->
++fsm_next_state(wait_for_resume, #state{mgmt_timeout = 0} = StateData) ->
++    {stop, normal, StateData};
++fsm_next_state(wait_for_resume, #state{mgmt_pending_since = undefined} =
++	       StateData) ->
+     ?INFO_MSG("Waiting for resumption of stream for ~s",
+ 	      [jlib:jid_to_string(StateData#state.jid)]),
+     {next_state, wait_for_resume,
diff --git a/debian/patches/series b/debian/patches/series
index c1d1b20..e868d4b 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -10,3 +10,4 @@ CVE-2014-8760.patch
 disable_internal_logrotate.patch
 fix_reopen_log.patch
 configure_ssl.patch
+avoid_hanging_c2s.patch

--- End Message ---
--- Begin Message ---
Hi,

On Thu, Dec 04, 2014 at 07:59:02AM +0100, Philipp Huebner wrote:
> Okay, building and testing the new package right now.

Unblocked.

Cheers,

Ivo

--- End Message ---

Reply to: