https://bz.apache.org/bugzilla/show_bug.cgi?id=69527

--- Comment #4 from Vigneshwaran N <palanivi...@gmail.com> ---
To reproduce the issue, configure the system to cache files exceeding 10MB. In
our case, we used approximately 100MB of static files. While fetching
JavaScript files required for the Web UI, we observed that multiple files
either had missing content or their contentLength was set to 0.

To pinpoint the root cause, we introduced extensive logging in the cache.java
and cachedResource.java code. The investigation revealed a race condition where
Thread 2 evicted the resource added by Thread 1 before Thread 1 had completed
its initialization. This premature removal caused cachedContentLength to be
incorrectly calculated, leading to the resource being treated as empty and not
delivered to the client.

Further analysis showed that this race condition was inadvertently introduced
in commit 636017459a88befe1c5f1fd9d8f31ff2f13f74f6. This commit was intended to
address an issue with incorrect cache size calculations for concurrent
PUT/DELETE operations, but it introduced a new edge case that resulted in this
behavior.

This issue surfaced after we migrated from Tomcat version 9.0.96 to 9.0.97 as
part of a security fix for CVE-2024-50379.

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org

Reply via email to