Hi,

This fix addresses an issue in AuthenticationFilter.Cache::remove that can lead to a ConcurrentModificationException. The cache is implemented as LinkedList, the method iterates over the list and potentially removes items without using an iterator.

To reproduce the bug, multiple requests are sent asynchronously so that successful response headers might arrive concurrently and compete in updating the cache. This increases the chances to trigger the removal of a previously cached credential while storing the credentials of the next response. Under these circumstances, ConcurrentModificationException is thrown with very high frequency (if not always).

The proposed fix replaces LinkedList with CopyOnWriteArrayList to preclude the exception.

Bug: https://bugs.openjdk.java.net/browse/JDK-8232853

Webrev: http://cr.openjdk.java.net/~jboes/webrevs/8232853/webrev.01/index.html

The test fails reliably without the fix, and passes with it (jdk_net tests run 50 times).


Regards,

Julia


Reply via email to