Skip to content
This repository has been archived by the owner on Oct 12, 2023. It is now read-only.

Support registered processes as ancestors #58

Conversation

britto
Copy link
Contributor

@britto britto commented Jul 2, 2018

The ancestry tree fetched from the current process dictionary may contain some registered process names (atoms), rather than just PIDs. In that case New Relixir would crash with this error:

** (ArgumentError) argument error
    :erlang.process_info(:named_ancestor, :dictionary)
    (elixir) lib/process.ex:646: Process.info/2
    lib/new_relixir/current_transaction.ex:51: NewRelixir.CurrentTransaction.extract_transaction/1
    (elixir) lib/enum.ex:2914: Enum.find_value_list/3
    lib/new_relixir/current_transaction.ex:44: NewRelixir.CurrentTransaction.search_on_ancestors/0
    lib/new_relixir/current_transaction.ex:21: NewRelixir.CurrentTransaction.get/0
    (elixir) lib/task/supervised.ex:88: Task.Supervised.do_apply/2
    (elixir) lib/task/supervised.ex:38: Task.Supervised.reply/5
    (stdlib) proc_lib.erl:247: :proc_lib.init_p_do_apply/3
Function: &NewRelixir.CurrentTransaction.get/0
    Args: []

Fixes #57.

The ancestry tree fetched from the current process dictionary may
contain some registered process names (atoms), rather than solely
PIDs. In that case New Relixir would crash with this error:

    ** (ArgumentError) argument error
        :erlang.process_info(:named_ancestor, :dictionary)
        (elixir) lib/process.ex:646: Process.info/2
        lib/new_relixir/current_transaction.ex:51: NewRelixir.CurrentTransaction.extract_transaction/1
        (elixir) lib/enum.ex:2914: Enum.find_value_list/3
        lib/new_relixir/current_transaction.ex:44: NewRelixir.CurrentTransaction.search_on_ancestors/0
        lib/new_relixir/current_transaction.ex:21: NewRelixir.CurrentTransaction.get/0
        (elixir) lib/task/supervised.ex:88: Task.Supervised.do_apply/2
        (elixir) lib/task/supervised.ex:38: Task.Supervised.reply/5
        (stdlib) proc_lib.erl:247: :proc_lib.init_p_do_apply/3
    Function: &NewRelixir.CurrentTransaction.get/0
        Args: []
@britto britto force-pushed the support-registered-processes-as-ancestors branch from 148f42a to bac7dfc Compare July 2, 2018 23:32
@coburncoburn coburncoburn merged commit 25ecb3f into TheRealReal:master Jul 3, 2018
@britto britto deleted the support-registered-processes-as-ancestors branch July 11, 2018 15:08
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants