[erlang-bugs] Problem with tw timer support in diameter app (otp_R16B)

Anders Svensson <>
Mon May 27 17:12:44 CEST 2013


Thanks for the report. The fix should be in the maint branch (destined
for R16B01) by the end of the week.

Anders


On Mon, May 20, 2013 at 10:41 AM, Aleksander Nycz
<> wrote:
> Hello,
>
> I change default value for param restrict_connections from 'nodes' to
> 'false'.
> After that I run very simple test using seagull symulator. Test scenario was
> following:
>
> 1. seagull: send CER
> 2. seagull: recv CEA
> 3. seagull: send CCR (init)
> 4. seagull: recv CCA (init)
> 5. seagull: send CCR (update)
> 6. seagull: recv CCR (update)
> 7. seagull: send CCR (terminate)
> 8. seagull: recv CCA (terminate)
>
> After step 8. seagull does't send DPR, but just closes transport connection
> (TCP)
>
> On server side every think looks good, but 30 sec. after CCR (terminate)
> when tw elapsed, following error message appears in log:
>
>
> 13:40:58.187129: <0.5046.0>: error: error_logger: --:--/--: ** Generic
> server <0.5046.0> terminating
> ** Last message in was {timeout,#Ref<0.0.0.14845>,tw}
> ** When Server state == {watchdog,down,false,30000,0,<0.1009.0>,undefined,
>                             #Ref<0.0.0.14845>,diameter_gen_base_rfc3588,
>                             {recvdata,4259932,diameterNode,
>                                 [{diameter_app,diameterNode,dictionaryDCCA,
>                                      [dccaCallback],
>                                      diameterNode,4,false,
>                                      [{answer_errors,report},
>                                       {request_errors,answer_3xxx}]}],
>                                 {0,32}},
>                             {0,32},
>                             {false,false},
>                             false}
> ** Reason for termination ==
> ** {function_clause,
>        [{diameter_watchdog,set_watchdog,
>             [stop],
>             [{file,"base/diameter_watchdog.erl"},{line,451}]},
>         {diameter_watchdog,handle_info,2,
>             [{file,"base/diameter_watchdog.erl"},{line,211}]},
>         {gen_server,handle_msg,5,[{file,"gen_server.erl"},{line,597}]},
>         {proc_lib,init_p_do_apply,3,[{file,"proc_lib.erl"},{line,227}]}]}
>
> 13:40:58.187500: <0.5046.0>: error: error_logger: --:--/--:
> [crash_report][[[{initial_call,{diameter_watchdog,init,['Argument__1']}},
>                  {pid,<0.5046.0>},
>                  {registered_name,[]},
>
> {error_info,{exit,{function_clause,[{diameter_watchdog,set_watchdog,[stop],[{file,"base/diameter_watchdog.erl"},{line,451}]},
>
> {diameter_watchdog,handle_info,2,[{file,"base/diameter_watchdog.erl"},{line,211}]},
>
> {gen_server,handle_msg,5,[{file,"gen_server.erl"},{line,597}]},
>
> {proc_lib,init_p_do_apply,3,[{file,"proc_lib.erl"},{line,227}]}]},
>
> [{gen_server,terminate,6,[{file,"gen_server.erl"},{line,737}]},
>
> {proc_lib,init_p_do_apply,3,[{file,"proc_lib.erl"},{line,227}]}]}},
>                  {ancestors,[diameter_watchdog_sup,diameter_sup,<0.946.0>]},
>                  {messages,[]},
>                  {links,[<0.954.0>]},
>                  {dictionary,[{random_seed,{15047,18051,14647}},
>                               {{diameter_watchdog,restart},
>                                {{accept,#Ref<0.0.0.1696>},
>                                 [{transport_module,diameter_tcp},
>
> {transport_config,[{reuseaddr,true},{ip,{0,0,0,0}},{port,4068}]},
>
> {capabilities_cb,[#Fun<diameterNode.acceptCER.2>]},
>                                  {watchdog_timer,30000},
>                                  {reconnect_timer,60000}],
>                                 {diameter_service,<0.1009.0>,
>
> {diameter_caps,"zyndram.krakow.comarch","krakow.comarch",[],25429,"Comarch
> DIAMETER Server",[],
>
> [12645,10415,8164],
>                                                                  [4],
>
> [],[],[],[],[]},
>
> [{diameter_app,diameterNode,dictionaryDCCA,
>
> [dccaCallback],
>
> diameterNode,4,false,
>
> [{answer_errors,report},{request_errors,answer_3xxx}]}]}}},
>                               {{diameter_watchdog,dwr},
>
> ['DWR',{'Origin-Host',"zyndram.krakow.comarch"},{'Origin-Realm',"krakow.comarch"},{'Origin-State-Id',[]}]}]},
>                  {trap_exit,false},
>                  {status,running},
>                  {heap_size,75025},
>                  {stack_size,24},
>                  {reductions,294}],
>                 []]]
> 13:40:58.189060: <0.954.0>: error: error_logger: --:--/--:
> [supervisor_report][[{supervisor,{local,diameter_watchdog_sup}},
>                      {errorContext,child_terminated},
>
> {reason,{function_clause,[{diameter_watchdog,set_watchdog,[stop],[{file,"base/diameter_watchdog.erl"},{line,451}]},
>
> {diameter_watchdog,handle_info,2,[{file,"base/diameter_watchdog.erl"},{line,211}]},
>
> {gen_server,handle_msg,5,[{file,"gen_server.erl"},{line,597}]},
>
> {proc_lib,init_p_do_apply,3,[{file,"proc_lib.erl"},{line,227}]}]}},
>                      {offender,[{pid,<0.5046.0>},
>                                 {name,diameter_watchdog},
>
> {mfargs,{diameter_watchdog,start_link,undefined}},
>                                 {restart_type,temporary},
>                                 {shutdown,1000},
>                                 {child_type,worker}]}]]
>
> You can check, that function set_watchdog should be called with param
> #watchdog{}, but 'stop' param is used instead.
> As a result function_clause exception is thrown.
>
> I suggest following change in code to correct this problem (file
> diameter_watchdog.erl):
>
> $ diff diameter_watchdog.erl_org diameter_watchdog.erl
> 385a386,393
>> transition({timeout, TRef, tw}, #watchdog{tref = TRef, status = T} = S)
>>   when T == initial;
>>        T == down ->
>>     case restart(S) of
>>         stop -> stop;
>>         #watchdog{} = NewS -> set_watchdog(NewS)
>>     end;
>>
>
> You can find this solution in attachement.
>
> Best regards
> Aleksander Nycz
>
> --
> Aleksander Nycz
> Senior Software Engineer
> Telco_021 BSS R&D
> Comarch SA
> Phone:  +48 12 646 1216
> Mobile: +48 691 464 275
> website: www.comarch.pl
>
>
> _______________________________________________
> erlang-bugs mailing list
> 
> http://erlang.org/mailman/listinfo/erlang-bugs
>


More information about the erlang-bugs mailing list