[erlang-bugs] [erlang-questions] inets http --- httpc_handler, retry_pipline - Bug - Patch

Sanjaya Vitharana sanjaya@REDACTED
Thu Jul 12 07:38:54 CEST 2007


Hi All,

This seems a Bug in inets. Refer with httpc_handler:retry_pipline/3 and http_util:key1search/3.

Find the attached log part with error details.

Quick Patch: httpc_handler:retry_pipline/3

785c 787
<                      Timer = {_, TimerRef} =
                                  http_util:key1search(RequestTimers, Request#request.id, 
                                   {undefined, undefined}),
---
>                      case lists:keysearch(Request#request.id, 1, RequestTimers) of
                               {value, Timer} ->
                                     {_, TimerRef} = Timer;
                                _ ->
                                     Timer = {_, TimerRef} = {undefined, undefined}
                        end,


Test Details: 

1> RequestTimers = [{make_ref(),make_ref()},{make_ref(),make_ref()}].
[{#Ref<0.0.0.31>,#Ref<0.0.0.32>},{#Ref<0.0.0.33>,#Ref<0.0.0.34>}]
2> [{_,_},{RequestID,_}] = RequestTimers.
[{#Ref<0.0.0.31>,#Ref<0.0.0.32>},{#Ref<0.0.0.33>,#Ref<0.0.0.34>}]
3> RequestID.
#Ref<0.0.0.33>
4> Timer = {_, TimerRef} =http_util:key1search(RequestTimers, RequestID,{undefined, undefined}).

=ERROR REPORT==== 9-Jul-2007::21:56:09 ===
Error in process <0.29.0> with exit value: {{badmatch,#Ref<0.0.0.34>},[{erl_eval,expr,3}]}

** exited: {{badmatch,#Ref<0.0.0.34>},[{erl_eval,expr,3}]} **
5> 
5> http_util:key1search(RequestTimers, RequestID,{undefined, undefined}).                       
#Ref<0.0.0.34>
6> 

Thanks,

Sanjaya Vitharana.

  ----- Original Message ----- 
  From: Sanjaya Vitharana 
  To: erlang-questions@REDACTED 
  Sent: Wednesday, 04 July 2007 12:12 pm
  Subject: [erlang-questions] inets http --- httpc_handler, retry_pipline


  Hi all,

  Anyone has a idea about below error & why it gets with
  http:request(get, {URL, []}, [{timeout, ?REQUEST_TIMEOUT},{autoredirect, true}], [{sync, false}]) ???

  I have get it with R11B-4 (emulator version 5.5.4  - inets-4.7.11). Is this a bug in in inets ??

  regards,

  Sanjaya Vitharana


  ** Reason for termination == 
  ** {{badmatch,#Ref<0.0.43.103898>},
      [{httpc_handler,retry_pipline,2},
       {httpc_handler,terminate,2},
       {gen_server,terminate,6},
       {proc_lib,init_p,5}]}

  =CRASH REPORT==== 4-Jul-2007::10:16:10 ===
    crasher:
      pid: <0.25066.9>
      registered_name: []
      error_info: {{badmatch,#Ref<0.0.43.103898>},
                    [{httpc_handler,retry_pipline,2},
                     {httpc_handler,terminate,2},
                     {gen_server,terminate,6},
                     {proc_lib,init_p,5}]}
      initial_call: {gen,
                       init_it,
                       [gen_server,
                        <0.54.0>,
                        <0.54.0>,
                        httpc_handler,
                        [{request,
                             #Ref<0.0.43.103750>,
                             <0.63.0>,
                             0,
                             http,
                             {"scrb.int",80},
                             "/vmail/vmStart.php",
                             "?key=c&session=a1183524542772308306&ch=56&serverid=3",
                             get,
                             {http_request_h,
                                 undefined,
                                 "keep-alive",
                                 undefined,
                                 undefined,
                                 undefined,
                                 undefined,
                                 undefined,
                                 undefined,
                                 undefined,
                                 undefined,
                                 undefined,
                                 undefined,
                                 undefined,
                                 undefined,
                                 undefined,
                                 undefined,
                                 "scrb.int",
                                 undefined,
                                 undefined,
                                 undefined,
                                 undefined,
                                 undefined,
                                 undefined,
                                 undefined,
                                 undefined,
                                 undefined,
                                 [],
                                 undefined,
                                 undefined,
                                 undefined,
                                 undefined,
                                 "0",
                                 undefined,
                                 undefined,
                                 undefined,
                                 undefined,
                                 undefined,
                                 undefined,
                                 []},
                             {[],[]},
                             {http_options,18000,true,[],undefined,false},
                             "http://scrb.int/vmail/vmStart.php?key=c&session=a1183524542772308306&ch=56&serverid=3",
                             [],
                             none,
                             []},
                         {options,{undefined,[]},0,2,2,disabled,enabled,false}],
                        []]}
      ancestors: [httpc_manager,httpc_sup,inets_sup,<0.50.0>]
      messages: []
      links: [<0.54.0>,#Port<0.390595>]
      dictionary: []
      trap_exit: true
      status: running
      heap_size: 4181
      stack_size: 21
      reductions: 12757
    neighbours:


------------------------------------------------------------------------------


  _______________________________________________
  erlang-questions mailing list
  erlang-questions@REDACTED
  http://www.erlang.org/mailman/listinfo/erlang-questions
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-bugs/attachments/20070712/6f37e775/attachment.htm>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: error_details.txt
URL: <http://erlang.org/pipermail/erlang-bugs/attachments/20070712/6f37e775/attachment.txt>


More information about the erlang-bugs mailing list