Skip to content

DiskReadViolation #360

Open
Open
@laurentlr

Description

@laurentlr

**SDK version: 3.10.0
**Environment: Development & Production

Are logs available?

StrictMode policy violation; ~duration=10 ms: android.os.strictmode.DiskReadViolation
    	at android.os.StrictMode$AndroidBlockGuardPolicy.onReadFromDisk(StrictMode.java:1661)
    	at libcore.io.BlockGuardOs.fstat(BlockGuardOs.java:194)
    	at libcore.io.ForwardingOs.fstat(ForwardingOs.java:261)
    	at libcore.io.IoBridge.open(IoBridge.java:563)
    	at java.io.FileOutputStream.<init>(FileOutputStream.java:236)
    	at java.io.FileOutputStream.<init>(FileOutputStream.java:186)
    	at kotlin.io.e.d(FileReadWrite.kt:20)
    	at io.customer.sdk.data.store.h.c(FileStorage.kt:41)
    	at io.customer.sdk.queue.QueueStorageImpl.a(QueueStorage.kt:95)
    	at io.customer.sdk.queue.QueueImpl.i(Queue.kt:68)
    	at io.customer.sdk.queue.QueueImpl.c(Queue.kt:39)
    	at pf.h.b(TrackRepository.kt:66)
    	at ef.c.c(PushMessageProcessorImpl.kt:50)
    	at io.customer.messagingpush.CustomerIOCloudMessagingReceiver.onReceive(CustomerIOCloudMessagingReceiver.kt:37)
    	at android.app.ActivityThread.handleReceiver(ActivityThread.java:4663)
    	at android.app.ActivityThread.-$$Nest$mhandleReceiver(Unknown Source:0)
    	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2357)
    	at android.os.Handler.dispatchMessage(Handler.java:107)
    	at android.os.Looper.loopOnce(Looper.java:232)
    	at android.os.Looper.loop(Looper.java:317)
    	at android.app.ActivityThread.main(ActivityThread.java:8501)
    	at java.lang.reflect.Method.invoke(Native Method)
    	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:552)
    	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:878)

Describe the bug
With StrictMode enabled, when sending a push notification, we can see DiskReadViolation. It's coming from your class CustomerIOCloudMessagingReceiver

To Reproduce

StrictMode.setThreadPolicy(
                StrictMode.ThreadPolicy.Builder()
                    .detectDiskReads()
                    .detectDiskWrites()
                    .detectAll()
                    .penaltyLog()
                    .build()

Expected behavior
There should not be any DiskReadViolation on main thread.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions