Skip to content

Handle errors in Harvest.HarvestCycle.send_harvest/2#534

Closed
sgessa wants to merge 1 commit into
newrelic:masterfrom
sgessa:catch-terminate-child-error
Closed

Handle errors in Harvest.HarvestCycle.send_harvest/2#534
sgessa wants to merge 1 commit into
newrelic:masterfrom
sgessa:catch-terminate-child-error

Conversation

@sgessa
Copy link
Copy Markdown

@sgessa sgessa commented Jun 15, 2025

This is an attempt to silent the error from Harvest.HarvestCycle.send_harvest/2 when the given supervisor is not started.

I wasn't able to reproduce this issue consistently.

Fixes #511

Example

exited in: GenServer.call(NewRelic.Harvest.Collector.CustomEvent.HarvesterSupervisor, {:terminate_child, #PID<0.1987228.0>}, :infinity)
    ** (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

Stacktrace

  File "lib/gen_server.ex", line 1121, in GenServer.call/3
  File "lib/new_relic/harvest/harvest_cycle.ex", line 134, in anonymous fn/2 in NewRelic.Harvest.HarvestCycle.send_harvest/2
  File "lib/task/supervised.ex", line 101, in Task.Supervised.invoke_mfa/2

@CLAassistant
Copy link
Copy Markdown

CLAassistant commented Jun 15, 2025

CLA assistant check
All committers have signed the CLA.

@binaryseed
Copy link
Copy Markdown
Collaborator

When you see this, does it line up with when your app deploys? I'm wondering if it's related to the shutdown process that the agent attempts when the supervision tree is shutting down

@sgessa
Copy link
Copy Markdown
Author

sgessa commented Jun 21, 2025

Yes it does

@binaryseed
Copy link
Copy Markdown
Collaborator

Closing in favor of #542 which does the same but avoids nested try blocks

@binaryseed binaryseed closed this Jul 22, 2025
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

Successfully merging this pull request may close these issues.

NewRelic.Harvest.Collector.SpanEvent.HarvesterSupervisor: the process is not alive

3 participants