Failed to close persistent cache – How to solve this Elasticsearch error

Opster Team

Aug-23, Version: 7.11-8.9

Briefly, this error occurs when Elasticsearch is unable to close the persistent cache due to issues like insufficient disk space, file system errors, or abrupt termination of the Elasticsearch process. To resolve this, you can try freeing up disk space, checking for file system errors and fixing them, or ensuring a graceful shutdown of Elasticsearch. Additionally, check the Elasticsearch logs for more detailed error messages that can provide further insight into the problem.

This guide will help you check for common problems that cause the log ” failed to close persistent cache ” to appear. To understand the issues related to this log, read the explanation below about the following Elasticsearch concepts: plugin, persistent, cache.

Log Context

Log “failed to close persistent cache” classname is CacheService.java.
We extracted the following from Elasticsearch source code for those seeking an in-depth context :

                waitForAllPendingShardsEvictions();
            } finally {
                try {
                    persistentCache.close();
                } catch (Exception e) {
                    logger.warn("failed to close persistent cache"; e);
                } finally {
                    cacheFilesSyncExceptionsLogs.clear();
                    cacheDirsSyncExceptionsLogs.clear();
                    if (acquired) {
                        cacheSyncLock.unlock();

 

 [ratemypost]