K1rakishou / K1rakishou/Caching-Image-Loader

ConcurrentModificationException in removeCorruptedEntries

Open
#7 0 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
Kotlin
Stars
6
Forks
3
PR merge metrics
No merged PRs in 30d

Description

thread: DefaultDispatcher-worker-1, Corrupted cache info file: count of files in the cache directory (21) != entries in the cache info file (12)

`Exception in thread "DefaultDispatcher-worker-1" java.util.ConcurrentModificationException
at java.base/java.util.HashMap$HashIterator.nextNode(HashMap.java:1498)
at java.base/java.util.HashMap$ValueIterator.next(HashMap.java:1526)
at cache.DiskCache.removeCorruptedEntries(DiskCache.kt:336)
at cache.DiskCache.innerReadCacheFile(DiskCache.kt:262)
at cache.DiskCache.access$innerReadCacheFile(DiskCache.kt:11)
at cache.DiskCache$cacheOperationsActor$1.invokeSuspend(DiskCache.kt:33)
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:32)
at kotlinx.coroutines.DispatchedTask$DefaultImpls.run(Dispatched.kt:235)
at kotlinx.coroutines.AbstractContinuation.run(AbstractContinuation.kt:19)
at kotlinx.coroutines.scheduling.Task.run(Tasks.kt:94)
at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:586)
at kotlinx.coroutines.scheduling.CoroutineScheduler.access$runSafely(CoroutineScheduler.kt:60)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:732)`

Contributor guide

No contributing guide indexed for this repository

Research direction

Start in DiskCache.kt at removeCorruptedEntries around line 336, following the call from innerReadCacheFile around line 262. Reproduce the corrupted-cache condition where the directory contains more files than the cache info file, then verify that cleanup completes without ConcurrentModificationException.

Written by the indexing model from the issue text.

Assessment

Tech stack
kotlin
Domain
backend
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.