8000 Intermittent: `(EXIT) shutdown: failed to start child: ConCache.LockSupervisor` · Issue #80 · sasa1977/con_cache · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Intermittent: (EXIT) shutdown: failed to start child: ConCache.LockSupervisor #80

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

Open
krisleech opened this issue Oct 8, 2024 · 0 comments

Comments

@krisleech
Copy link
krisleech commented Oct 8, 2024

When I run my tests or start iex I sometimes get the following error:

** (Mix) Could not start application export: Export.Application.start(:normal, []) returned an error: shutdown: failed to start child: ConCache
    ** (EXIT) shutdown: failed to start child: ConCache.LockSupervisor
        ** (EXIT) an exception was raised:
            ** (ArgumentError) unknown registry: ConCache
                (elixir 1.17.1) lib/registry.ex:1400: Registry.key_info!/1
                (elixir 1.17.1) lib/registry.ex:237: Registry.whereis_name/2
                (stdlib 5.2.3) gen.erl:107: :gen.start/6
                (stdlib 5.2.3) supervisor.erl:420: :supervisor.do_start_child_i/3
                (stdlib 5.2.3) supervisor.erl:406: :supervisor.do_start_child/2
                (stdlib 5.2.3) supervisor.erl:390: anonymous fn/3 in :supervisor.start_children/2
                (stdlib 5.2.3) supervisor.erl:1258: :supervisor.children_map/4
                (stdlib 5.2.3) supervisor.erl:350: :supervisor.init_children/2

It is intermittent, and typically if I run the tests again there is no error.

This is how is setup:

defmodule Export.Application do
  @moduledoc false

  use Application

  @impl true
  def start(_type, _args) do
    children = [
      Export.Scheduler,
      {
        ConCache,
        [
          name: :payment_method_cache,
          ttl_check_interval: :timer.seconds(5),
          global_ttl: :timer.minutes(10),
          touch_on_read: true
        ]
      }
    ]

    opts = [strategy: :one_for_one, name: Export.Supervisor]
    Supervisor.start_link(children, opts)
  end
end

defmodule Export.MixProject do
  use Mix.Project

  # ...

  def application do
    [
      extra_applications: [:logger, :con_cache],
      mod: {Export.Application, []}
    ]
  end
end

As per the docs I tried to add :con_cache to applications but I got a warning, I think extra_applications is now correct.

Any thoughts much appreciated ❤️

I noticed I also sometimes see: ** (Mix) Could not start application con_cache: could not find application file: con_cache.app, again this goes away on retry.

It also never seems to happen on CI.

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
0