-
Notifications
You must be signed in to change notification settings - Fork 97
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
Fix bug in top_process.ex when complex args are in use #389
base: master
Are you sure you want to change the base?
Conversation
|
We're seeing http connection timeouts due to slow server responses. This allows users to define custom configuration for the httpc request options so they can pass in a timeout that is relevant for their servers.
Allow custom httpc request options to be set
@@ -76,7 +76,7 @@ defmodule NewRelic.Sampler.TopProcess do | |||
defp parse(:name, pid, []) do | |||
with {:dictionary, dictionary} <- Process.info(pid, :dictionary), | |||
{m, f, a} <- Keyword.get(dictionary, :"$initial_call") do | |||
"#{inspect(m)}.#{f}/#{a}" | |||
"#{inspect(m)}.#{f}/#{inspect(a)}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Something else must be going wrong here. The a
in $initial_call
is set by Task
and is the arity - it is always a number.
Are you doing something manually with $initial_call
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nope not doing anything manually with initial call:
task_stream =
Task.Supervisor.async_stream_nolink(
XXXX.TaskSupervisor,
batches,
callback_module,
:execute,
[refined_context],
max_concurrency: callback_module.max_concurrency(),
timeout: :infinity
)
Hi,
I ran into a bug when spawning supervised tasks via
Task.async_stream_nolink/6
. When spawning tasks with MFA, the TopProcess GenServer will crash when trying to parse the spawned Tasks info if the args passed to it cannot be simply converted to a string during interpolation.In my case, this occured when passing
[[String.t()], map()]
, which resulted in the following error:This fix simply adds an inspect call within the string interpolation which prevents this issue. I have tested this and it resolves the issue.