Skip to content

Detect competing access to DiskLruCache; explode #680

@kaciula

Description

@kaciula

I'm getting crash reports from users of my Android app with the following stacktrace:

java.lang.RuntimeException: java.io.IOException
       at com.squareup.okhttp.internal.DiskLruCache$1.run(DiskLruCache.java:175)
       at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1080)
       at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:573)
       at java.lang.Thread.run(Thread.java:841)
Caused by: java.io.IOException
       at com.squareup.okhttp.internal.DiskLruCache.renameTo(DiskLruCache.java:390)
       at com.squareup.okhttp.internal.DiskLruCache.rebuildJournal(DiskLruCache.java:372)
       at com.squareup.okhttp.internal.DiskLruCache.access$300(DiskLruCache.java:86)
       at com.squareup.okhttp.internal.DiskLruCache$1.run(DiskLruCache.java:171)
       at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1080)
       at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:573)
       at java.lang.Thread.run(Thread.java:841)

Right now, all affected users are on Android 4.3

All I am doing is using a OkHttpClient singleton with a HttpResponseCache attached.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementFeature not a bugneeds infoMore information needed from reporter

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions