Skip to content
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 celery where workers don't report data #696

Merged
merged 1 commit into from
Nov 30, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions newrelic/api/application.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,18 +33,18 @@ def _instance(name, activate=True):
if name is None:
name = newrelic.core.config.global_settings().app_name

# Ensure we grab a reference to the agent before grabbing
# the lock, else startup callback on agent initialisation
# could deadlock as it tries to create a application when
# we already have the lock held.

agent = newrelic.core.agent.agent_instance()

# Try first without lock. If we find it we can return.

instance = Application._instances.get(name, None)

if not instance and activate:
# Ensure we grab a reference to the agent before grabbing
# the lock, else startup callback on agent initialisation
# could deadlock as it tries to create a application when
# we already have the lock held.

agent = newrelic.core.agent.agent_instance()

with Application._lock:
# Now try again with lock so that only one gets
# to create and add it.
Expand Down