Skip to content

Bad argument in arithmetic expression #38

@slashdotdash

Description

@slashdotdash

Environment

  • Elixir: v1.6.6
  • Operating system: Docker container running alpine-elixir

Current behavior

We've encountered the following exception numerous times in production error reports when using the pigeon library for sending large batches of FCM push notifications (1,000 notifications):

Elixir.ArithmeticError: bad argument in arithmetic expression
  File "lib/connection/processor.ex", line 131, in Kadabra.Connection.Processor.process/2
  File "lib/connection.ex", line 155, in Kadabra.Connection.handle_info/2
  File "gen_server.erl", line 616, in :gen_server.try_dispatch/4
  File "gen_server.erl", line 686, in :gen_server.handle_msg/6
  File "proc_lib.erl", line 247, in :proc_lib.init_p_do_apply/3
  Module "Elixir.Kadabra.Connection", in Kadabra.Connection.init/1

Unfortunately I haven't seen it happen locally, nor have I been able to reproduce it.

I've looked through Kadabra.Connection.Processor module and am wondering whether the issue is because the default max_concurrent_streams setting in the Kadabra.Connection.Settings module is :infinite but line 131 is assuming it will be a number:

to_ask =
  settings.max_concurrent_streams - flow.stream_set.active_stream_count

Could that be the culprit for the exception?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions