codedge-llc / kadabra

HTTP/2 client for Elixir
https://hex.pm/packages/kadabra
MIT License
43 stars 23 forks source link

** State machine {Registry.Kadabra, {#Reference<>, 39}} terminating #30

Closed msmykowski closed 6 years ago

msmykowski commented 6 years ago
06:37:59.034 [error] ** State machine {Registry.Kadabra, {#Reference<0.2238806796.3053715460.107751>, 39}} terminating
** Last event = {:cast,
 {:recv,
  %Kadabra.Frame.Headers{end_headers: true, end_stream: false, exclusive: nil,
   header_block_fragment: <<140, 31, 47, 156, 192, 211, 173, 94, 134, 246, 21,
     156, 127, 13, 213, 155, 186, 219, 75, 60, 40, 64, 179, 176, 223, 135, 11,
     111, 57, 125, 225, 95>>, priority: false, stream_dependency: nil,
   stream_id: 39, weight: nil}}}
** When server state  = {:open,
 %Kadabra.Stream{body: "", buffer: "", connection: #PID<0.2125.0>,
  flow: %Kadabra.Stream.FlowControl{max_frame_size: 16384, queue: [],
   stream_id: 39, window: 65405}, headers: [], id: 39,
  ref: #Reference<0.2238806796.3053715460.107751>, scheme: :https,
  settings: nil,
  socket: {:sslsocket, {:gen_tcp, #Port<0.69649>, :tls_connection, :undefined},
   #PID<0.2129.0>}, uri: 'api.development.push.apple.com'}}
** Reason for termination = :exit:{{{:badmatch, :undefined},
  [{:hpack, :decode_literal_header_never_indexed, 3,
    [file: '/Users/msmykowski/Br/ndc/deps/hpack/src/hpack.erl', line: 206]},
   {Kadabra.Hpack, :handle_call, 3, [file: 'lib/hpack.ex', line: 42]},
   {:gen_server, :try_handle_call, 4, [file: 'gen_server.erl', line: 636]},
   {:gen_server, :handle_msg, 6, [file: 'gen_server.erl', line: 665]},
   {:proc_lib, :init_p_do_apply, 3, [file: 'proc_lib.erl', line: 247]}]},
 {GenServer, :call,
  [{:via, Registry,
    {Registry.Kadabra, {#Reference<0.2238806796.3053715460.107751>, :decoder}}},
   {:decode,
    <<140, 31, 47, 156, 192, 211, 173, 94, 134, 246, 21, 156, 127, 13, 213, 155,
      186, 219, 75, 60, 40, 64, 179, 176, 223, 135, 11, 111, 57, 125, 225,
      95>>}, 5000]}}
** Callback mode = [:handle_event_function, :state_enter]
** Stacktrace =
**  [{GenServer, :call, 3, [file: 'lib/gen_server.ex', line: 774]},
 {Kadabra.Stream, :recv, 3, [file: 'lib/stream.ex', line: 124]},
 {:gen_statem, :call_state_function, 5, [file: 'gen_statem.erl', line: 1242]},
 {:gen_statem, :loop_event, 6, [file: 'gen_statem.erl', line: 1012]},
 {:proc_lib, :init_p_do_apply, 3, [file: 'proc_lib.erl', line: 247]}]`

I mentioned this in a previous issue, but thought I would create a new issue since it seems to be a separate concern. We are seeing this issue pop up fairly frequently.

hpopp commented 6 years ago

Geez yeah, header decoding is out of order. Fixing one should fix both issues I'm fairly certain.