OpenLiberty / open-liberty

Open Liberty is a highly composable, fast to start, dynamic application server runtime environment
https://openliberty.io
Eclipse Public License 2.0
1.16k stars 599 forks source link

Multiple entries may be added to the Authentication Cache for a custom cache key hashtable login #17155

Closed una-tapa closed 3 years ago

una-tapa commented 3 years ago

Describe the bug Under high stress environment, duplicate entries may be added to the Authentication Cache for one custom cache key. It may cause an increased authentication and an extra memory usage.

Steps to Reproduce Send multiple requests that will result in the same custom cache key, such as configure a TAI (TrustAssociationInterceptor) and send requests that makes TAI to create the same custom cache key.

Expected behavior For the initial login with the request, Liberty may create authcache entries with several different keys (one for token, another for the cache key etc). After that, the cache entries for the same subject should not grow.

Diagnostic information:

To diagnose, eclipse memory analyzer tool was used (https://www.eclipse.org/mat/) with IBM Extension. "IBM Extensions" -> "WebSphere Application Server" -> "Security" -> "Authentication Cache Overview" it shows the entries as well as the keys.

Additional context Add any other context about the problem here.

utle commented 3 years ago

Fixed by https://github.com/OpenLiberty/open-liberty/pull/17147

una-tapa commented 3 years ago

I guess I should have closed this issue. Additional code is checked in via Issue 17605 PR 17642