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

Application unable to start intermittently after upgrading from 5.8.0 to 7.4.2 #621

Closed
twcrone opened this issue Dec 22, 2021 · 3 comments · Fixed by #707
Closed

Application unable to start intermittently after upgrading from 5.8.0 to 7.4.2 #621

twcrone opened this issue Dec 22, 2021 · 3 comments · Fixed by #707
Assignees
Labels
GTSE There is an associated support escalation with this issue.

Comments

@twcrone
Copy link
Contributor

twcrone commented Dec 22, 2021

Customer upgraded Java agent to 7.4.2 from 5.8.0 to address the log4j security issue.

After upgrade, customer could not start their application intermittently. They get the following error in newrelic.log when that happens. This happens very randomly. According to customer, usually this happens 1 out of 4 application restarts.

java.lang.NullPointerException: null
at com.newrelic.agent.stats.StatsServiceImpl.doStatsWork(StatsServiceImpl.java:61) ~[newrelic.jar:7.4.2]
at com.newrelic.agent.service.ServiceManagerImpl.replayStartupStatsWork(ServiceManagerImpl.java:585) ~[newrelic.jar:7.4.2]
at com.newrelic.agent.service.ServiceManagerImpl.doStart(ServiceManagerImpl.java:195) ~[newrelic.jar:7.4.2]
at com.newrelic.agent.service.AbstractService.start(AbstractService.java:63) ~[newrelic.jar:7.4.2]
at com.newrelic.agent.Agent.continuePremain(Agent.java:162) [newrelic.jar:7.4.2]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_171]```
@twcrone twcrone added the GTSE There is an associated support escalation with this issue. label Dec 22, 2021
@twcrone
Copy link
Contributor Author

twcrone commented Dec 22, 2021

@meiao
Copy link
Contributor

meiao commented Dec 22, 2021

Fix should leverage:

  • guarding the specific code to prevent NPE;
  • preventing a null StatWork from being added to the collection, and logging when such thing happens with some context on what was supposed to be the null StatWork.

@jasonjkeller
Copy link
Contributor

Copying a comment from Jeff:

I really don't think it's a multithreaded issue; the "real" premain isn't even complete.
But given that it appears that the class transformer service does start an executor prior to the startup stats happening, it's possible there are multithreaded things.
I'm not clear on Lists -- we're changing the list, not the field, so I'm not clear that making the field volatile passes semantics onto the full object.
Nonetheless, it seems reasonable that we could get unguarded nulls in the list. The API doesn't prevent it. So I think it's reasonable to both a) synchronize access to the list and b) avoid nulls when pulling stuff out of the list.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
GTSE There is an associated support escalation with this issue.
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

4 participants