We have had at least two services hit this issue where CPU usage quickly jumps up to 100%, essentially leading to an outage for that host. Thread dumps show service threads stuck on
java.util.WeakHashMap.put(WeakHashMap.java:453)
at io.opentracing.contrib.specialagent.rule.servlet.FilterAgentIntercept.setStatusCode(FilterAgentIntercept.java:95)
at org.springframework.security.web.util.OnCommittedResponseWrapper.sendRedirect(OnCommittedResponseWrapper.java:128)
at org.springframework.security.web.DefaultRedirectStrategy.sendRedirect(DefaultRedirectStrategy.java:57)
..
Sometimes the callers of setStatusCode are different, but they seem to usually be about redirects (might just be this workload).
Use of an unprotected Weak/HashMap can easily cause this. I'm surprised we haven't caught this before now.
This needs to be fixed by either synchronizing the WeakHashMap access or by using a ConcurrentHashMap with WeakReferences somehow.
We have had at least two services hit this issue where CPU usage quickly jumps up to 100%, essentially leading to an outage for that host. Thread dumps show service threads stuck on
java.util.WeakHashMap.put(WeakHashMap.java:453)
at io.opentracing.contrib.specialagent.rule.servlet.FilterAgentIntercept.setStatusCode(FilterAgentIntercept.java:95) at org.springframework.security.web.util.OnCommittedResponseWrapper.sendRedirect(OnCommittedResponseWrapper.java:128) at org.springframework.security.web.DefaultRedirectStrategy.sendRedirect(DefaultRedirectStrategy.java:57) .. Sometimes the callers of setStatusCode are different, but they seem to usually be about redirects (might just be this workload).
Use of an unprotected Weak/HashMap can easily cause this. I'm surprised we haven't caught this before now.
This needs to be fixed by either synchronizing the WeakHashMap access or by using a ConcurrentHashMap with WeakReferences somehow.