Skip to content

infinite loop when compiling oban telemetry #14785

@dkuku

Description

@dkuku

Elixir and Erlang/OTP versions

Erlang/OTP 27 [erts-15.2.7] [source] [64-bit] [smp:16:16] [ds:16:16:10] [async-threads:1] [jit:ns]

Elixir 1.20.0-dev (21c76b5) (compiled with Erlang/OTP 27)
and also:
Erlang/OTP 28 [erts-16.1] [source] [64-bit] [smp:16:16] [ds:16:16:10] [async-threads:1] [jit:ns]

Elixir 1.20.0-dev (811767f) (compiled with Erlang/OTP 28)

Operating system

linux latest

Current behavior

I spotted it quite some time ago that compiling oban hangs on the oban telemetry module on elixir master.
You can just run mix test in oban from github.
I managed to shrink the code to fit on one screen and it still hangs on mix test. Now when removing any line from this module, it proceeds so I'm just reporting this minimal example.

defmodule Loop do
  def hello(_opts) do
    &__MODULE__.handle_event/4
  end

  def handle_event([:oban, :notifier, :switch], _measure, %{status: _status}, _opts) do
    :ok
  end

  def handle_event([:oban, :peer, :election, :stop], _measure, meta, _opts) do
    %{leader: _leader, was_leader: _was_leader} = meta

    :ok
  end

  def handle_event([:oban, :queue, :shutdown], _measure, %{orphaned: [_ | _]} = _meta, _opts) do
    :ok
  end

  def handle_event([:oban, :stager, :switch], _measure, %{mode: _mode}, _opts) do
    :ok
  end

  def handle_event(_event, _measure, _meta, _opts), do: :ok
end

when running mix test in a project with just this module it prints:

Compiling 1 file (.ex)
Verifying Loop (it's taking more than 10s)

and my cpu starts to overheat.

Expected behavior

module compiles

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions