Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"no process" error when a producer was trying to check out a process from the pool #77

Open
x-ji opened this issue May 11, 2021 · 0 comments

Comments

@x-ji
Copy link

x-ji commented May 11, 2021

Hi, we encountered this weird error and we're not sure how to look into it further.

May 6, 2021 @ 17:05:03.765    lib/ex_rabbit_pool.ex:21: ExRabbitPool.get_connection_worker/1
May 6, 2021 @ 17:05:03.765    /opt/app/deps/poolboy/src/poolboy.erl:63: :poolboy.checkout/3
	May 6, 2021 @ 17:05:03.765
    (stdlib 3.13.2) gen_server.erl:246: :gen_server.call/3
May 6, 2021 @ 17:05:03.765    lib/ex_rabbit_pool.ex:36: ExRabbitPool.with_channel/2
	May 6, 2021 @ 17:05:03.765
    ** (EXIT) no process: the process is not alive or there's no process currently associated with the given name, possibly because its application isn't started
May 6, 2021 @ 17:05:03.765** (exit) exited in: :gen_server.call(:assistant_producers_pool, {:checkout, #Reference<0.647931993.1703411713.0>, true}, 5000)
May 6, 2021 @ 17:05:03.765    (assistant 0.0.1) lib/assistant/attachments/events/received_parser_response.ex:15: Assistant.Attachments.Events.ReceivedParserResponse.emit_received_parser_response/1
May 6, 2021 @ 17:05:03.765    (assistant 0.0.1) lib/assistant/rabbit/producer/publisher.ex:12: Assistant.Rabbit.Producer.Publisher.publish/5

It seems (the interpretation might be wrong though) that the pool provided the producer with a reference, but when the producer actually tried to check out that reference, it cannot find the process, and thus it crashed.

Has anybody seen something similar before? We wonder what could be the potential cause that a connection process is no longer alive/cannot be found under the reference given by ex_rabbit_pool. Could it be that when the pool is being intensely used (it's a segment of code where a lot of events are being emitted), its resources could be starved/a race condition occurs?

The config to initialize the producer pool (which I'm not sure if contains anything out of the ordinary):

  def init_producer_pool(application) when is_atom(application) do
    rabbit_config = get_rabbit_config()

    producers_pool = [
      name: {:local, Helpers.build_producers_pool(application)},
      worker_module: ExRabbitPool.Worker.RabbitConnection,
      size: max(1, Producer.count_producers(application)),
      max_overflow: 0
    ]

    {:ok, _pid} =
      ExRabbitPool.PoolSupervisor.start_link(
        rabbitmq_config: [
          channels: 1,
          username: Keyword.fetch!(rabbit_config, :rabbit_user),
          password: Keyword.fetch!(rabbit_config, :rabbit_password),
          host: Keyword.fetch!(rabbit_config, :rabbit_host),
          port: Keyword.fetch!(rabbit_config, :rabbit_port)
        ],
        connection_pools: [producers_pool]
      )

    :ok
  end

Nevertheless, I wonder if tweaking some config (e.g. increase the size, the max_overflow (it's not clear from a simple search of the documentation what this is used for), or the channels could help?

Thanks.

@x-ji x-ji changed the title no process error when a producer was trying to check out a connection from the pool "no process" error when a producer was trying to check out a process from the pool May 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant