A soft-locked cache entry was expired by the underlying Ehcache

Still need help?

The Atlassian Community is here for you.

Ask the community

Symptoms

The following appears in the atlassian-bitbucket.log:

2012-10-10 09:16:59,516 WARN  [scheduler_Worker-5] n.s.e.h.s.AbstractReadWriteEhcacheAccessStrategy Cache com.atlassian.crowd.model.user.InternalUser.credentialRecords Key com.atlassian.crowd.model.user.InternalUser.credentialRecords#4718627 Lockable : null
A soft-locked cache entry was expired by the underlying Ehcache. If this happens regularly you should consider increasing the cache timeouts and/or capacity limits

2012-10-10 09:17:00,686 WARN  [scheduler_Worker-5] n.s.e.h.s.AbstractReadWriteEhcacheAccessStrategy Cache com.atlassian.crowd.model.user.InternalUser Key com.atlassian.crowd.model.user.InternalUser#4423730 Lockable : null
A soft-locked cache entry was expired by the underlying Ehcache. If this happens regularly you should consider increasing the cache timeouts and/or capacity limits

Cause

A soft-locked cache entry expired. These warning are known behavior in Bitbucket Server and tend to happen when the Crowd user management component syncs with an external user directory and cycles through all the users quickly (thus evicting some users that may be needed in other requests operating at the same time). If you ignore these warnings then Bitbucket Server will need to do make some extra calls to the database to retrieve user information. We do not believe these extra database calls would materially impact the performance of your Bitbucket Server instance.

Resolution

Bitbucket Server 3.2+ no longer uses Ehcache. The default limit for the new caching framework is 2000 for both InternalUser and InternalUser.credentialRecords.

Increase the Ehcache maxElementsInMemory limit to get rid of the WARNs:

  1. Edit the file bitbucket-1.3.00/atlassian-bitbucket/WEB-INF/classes/ehcache.xml inside the Bitbucket Server Installation Directory
  2. Locate the following classes: com.atlassian.crowd.model.user.InternalUser.credentialRecords and com.atlassian.crowd.model.user.InternalUser
<cache name="com.atlassian.crowd.model.user.InternalUser.credentialRecords"
           eternal="false"
           maxElementsInMemory="500" --> "1000"
           timeToIdleSeconds="1800"
           timeToLiveSeconds="1800"
           overflowToDisk="false"
           memoryStoreEvictionPolicy="LFU"/>

<cache name="com.atlassian.crowd.model.user.InternalUser"
           eternal="false"
           maxElementsInMemory="500" --> "1000"
           timeToIdleSeconds="1800"
           timeToLiveSeconds="1800"
           overflowToDisk="false"
           memoryStoreEvictionPolicy="LFU"/>

(info) So basically the values are 500 and we are changing them to 1000 - restart Bitbucket Server and that should make the WARNs to disapear from the logs.

Last modified on Mar 30, 2016

Was this helpful?

Yes
No
Provide feedback about this article
Powered by Confluence and Scroll Viewport.