History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: EJAB-617
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Minor Minor
Assignee: Badlop
Reporter: Badlop
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
ejabberd development

Improve confusing log message in s2s connection: wait_for_validation connect timeout

Created: 27/Apr/08 12:09 PM   Updated: 29/Apr/08 07:01 PM
Component/s: s2s
Affects Version/s: ejabberd 2.0.0
Fix Version/s: ejabberd 2.1.0, ejabberd 2.0.1

Time Tracking:
Not Specified

Participants: Badlop
Company: process-one.net (Find related issues)
Labels:
Sequential: 2


 Description  « Hide
When establishing a s2s connection with a remote Jabber server, ejabberd shows those messages in the log file:

=INFO REPORT==== 27-Apr-2008::11:15:22 ===
I(<0.498.0>:ejabberd_s2s:362) : New s2s connection started <0.518.0>

=INFO REPORT==== 27-Apr-2008::11:15:22 ===
I(<0.518.0>:ejabberd_s2s_out:1040) : Trying to open s2s connection: jabber.local -> jabber.remote.org

=INFO REPORT==== 27-Apr-2008::11:15:37 ===
I(<0.262.0>:ejabberd_listener:114) : (#Port<0.467>) Accepted connection {{113,140,180,104},57596} -> {{112,118,1,11},5269}

=INFO REPORT==== 27-Apr-2008::11:15:38 ===
I(<0.518.0>:ejabberd_s2s_out:319) : Connection established: jabber.local -> jabber.remote.org

=INFO REPORT==== 27-Apr-2008::11:16:13 ===
I(<0.522.0>:ejabberd_s2s_out:416) : wait_for_validation: jabber.local -> jabber.remote.org (connect timeout)


The s2s connection was completed successfully, but the log still shows an intimidating message: "connect timeout". This message confuses the admin and thinks that something went wrong in the connection. The proof of this confusion is that several admins asked in the ejabberd chatroom since ejabberd 2.0.0 was released.

This message shouldn't be shown in the log files.

 All   Comments   Work Log   Change History   FishEye   Crucible      Sort Order: Ascending order - Click to sort in descending order
Badlop - 27/Apr/08 12:13 PM
I propose this simple patch:

--- a/src/ejabberd_s2s_out.erl
+++ b/src/ejabberd_s2s_out.erl
@@ -375,6 +375,14 @@ wait_for_validation({xmlstreamerror, _}, StateData) ->
              ?INVALID_XML_ERR ++ ?STREAM_TRAILER),
     {stop, normal, StateData};

+wait_for_validation(timeout, #state{verify = {VPid, VKey, SID}} = StateData)
+ when is_pid(VPid) and is_list(VKey) and is_list(SID) ->
+ %% This is an auxiliary s2s connection for dialback.
+ %% This timeout is normal and doesn't represent a problem
+ ?DEBUG("wait_for_validation: ~s -> ~s (timeout in verify connection)",
+ [StateData#state.myname, StateData#state.server]),
+ {stop, normal, StateData};
+
 wait_for_validation(timeout, StateData) ->
     ?INFO_MSG("wait_for_validation: ~s -> ~s (connect timeout)",
              [StateData#state.myname, StateData#state.server]),


Badlop - 29/Apr/08 07:01 PM
Patch applied to ejabberd trunk and 2.0.x branch in SVN r1311.