Just catching up on these threads. These two variables should simply be volatile, right?

Matthew Bellew wrote:
FlowController.incrementRequestCount() and FlowController.decrementRequestCount() access the variables _requestCount and _maxConcurrentRequestCount outside of any synchronized block. This makes it possible to _requestCount, especially on a multi-processor machine. The subtlety of this bug is that --_requestCount and ++_requestCount look atomic, but they are not.

In particular, we have an action that returns images. Since some pages contain many images, this controller can be hit my many requests concurrently from the same session. We hit the decrementRequestCount() assert quite frequently in production.

       assert _requestCount > 0 : request.getRequestURI();

Thanks,
Matt



Reply via email to