<p dir="auto">It may relate to <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="37712186" data-permission-text="Title is private" data-url="https://github.com/bumptech/glide/issues/84" data-hovercard-type="issue" data-hovercard-url="/bumptech/glide/issues/84/hovercard" href="https://github.com/bumptech/glide/issues/84">#84</a> but I am looking for a workaround for the <code class="notranslate">SocketTimeOutException</code> like below</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="System.err  
W  java.net.SocketTimeoutException
W      at java.net.PlainSocketImpl.read(PlainSocketImpl.java:491)
W      at java.net.PlainSocketImpl.access$000(PlainSocketImpl.java:46)
W      at java.net.PlainSocketImpl$PlainSocketInputStream.read(PlainSocketImpl.java:240)
W      at java.io.BufferedInputStream.read(BufferedInputStream.java:304)
W      at libcore.net.http.FixedLengthInputStream.read(FixedLengthInputStream.java:45)
W      at java.io.InputStream.read(InputStream.java:163)
W      at com.bumptech.glide.load.resource.bitmap.RecyclableBufferedInputStream.fillbuf(RecyclableBufferedInputStream.java:131)
W      at com.bumptech.glide.load.resource.bitmap.RecyclableBufferedInputStream.read(RecyclableBufferedInputStream.java:310)
W      at java.io.InputStream.read(InputStream.java:163)
W      at com.bumptech.glide.load.resource.bitmap.RecyclableBufferedInputStream.fillbuf(RecyclableBufferedInputStream.java:131)
W      at com.bumptech.glide.load.resource.bitmap.RecyclableBufferedInputStream.read(RecyclableBufferedInputStream.java:310)
W      at android.graphics.BitmapFactory.nativeDecodeStream(Native Method)
W      at android.graphics.BitmapFactory.decodeStream(BitmapFactory.java:535)
W      at com.bumptech.glide.load.resource.bitmap.Downsampler.decodeStream(Downsampler.java:310)
W      at com.bumptech.glide.load.resource.bitmap.Downsampler.downsampleWithSize(Downsampler.java:210)
W      at com.bumptech.glide.load.resource.bitmap.Downsampler.decode(Downsampler.java:179)
W      at com.bumptech.glide.load.resource.bitmap.StreamBitmapDecoder.decode(StreamBitmapDecoder.java:41)
W      at com.bumptech.glide.load.resource.bitmap.StreamBitmapDecoder.decode(StreamBitmapDecoder.java:18)
W      at com.bumptech.glide.load.resource.bitmap.ImageVideoBitmapDecoder.decode(ImageVideoBitmapDecoder.java:38)
W      at com.bumptech.glide.load.resource.bitmap.ImageVideoBitmapDecoder.decode(ImageVideoBitmapDecoder.java:19)
W      at com.bumptech.glide.load.resource.gifbitmap.GifBitmapWrapperResourceDecoder.decode(GifBitmapWrapperResourceDecoder.java:55)
W      at com.bumptech.glide.load.resource.gifbitmap.GifBitmapWrapperResourceDecoder.decode(GifBitmapWrapperResourceDecoder.java:20)
W      at com.bumptech.glide.load.engine.SourceResourceRunner.decodeFromSource(SourceResourceRunner.java:180)
W      at com.bumptech.glide.load.engine.SourceResourceRunner.runWrapped(SourceResourceRunner.java:141)
W      at com.bumptech.glide.load.engine.SourceResourceRunner.run(SourceResourceRunner.java:123)
W      at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:390)
W      at java.util.concurrent.FutureTask.run(FutureTask.java:234)
W      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1080)
W      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:573)
W      at java.lang.Thread.run(Thread.java:841)
W      at com.bumptech.glide.load.engine.executor.FifoPriorityThreadPoolExecutor$DefaultThreadFactory$1.run(FifoPriorityThreadPoolExecutor.java:52)
skia  D  ---- read threw an exception
D  --- decoder-&gt;decode returned false"><pre class="notranslate"><code class="notranslate">System.err  
W  java.net.SocketTimeoutException
W      at java.net.PlainSocketImpl.read(PlainSocketImpl.java:491)
W      at java.net.PlainSocketImpl.access$000(PlainSocketImpl.java:46)
W      at java.net.PlainSocketImpl$PlainSocketInputStream.read(PlainSocketImpl.java:240)
W      at java.io.BufferedInputStream.read(BufferedInputStream.java:304)
W      at libcore.net.http.FixedLengthInputStream.read(FixedLengthInputStream.java:45)
W      at java.io.InputStream.read(InputStream.java:163)
W      at com.bumptech.glide.load.resource.bitmap.RecyclableBufferedInputStream.fillbuf(RecyclableBufferedInputStream.java:131)
W      at com.bumptech.glide.load.resource.bitmap.RecyclableBufferedInputStream.read(RecyclableBufferedInputStream.java:310)
W      at java.io.InputStream.read(InputStream.java:163)
W      at com.bumptech.glide.load.resource.bitmap.RecyclableBufferedInputStream.fillbuf(RecyclableBufferedInputStream.java:131)
W      at com.bumptech.glide.load.resource.bitmap.RecyclableBufferedInputStream.read(RecyclableBufferedInputStream.java:310)
W      at android.graphics.BitmapFactory.nativeDecodeStream(Native Method)
W      at android.graphics.BitmapFactory.decodeStream(BitmapFactory.java:535)
W      at com.bumptech.glide.load.resource.bitmap.Downsampler.decodeStream(Downsampler.java:310)
W      at com.bumptech.glide.load.resource.bitmap.Downsampler.downsampleWithSize(Downsampler.java:210)
W      at com.bumptech.glide.load.resource.bitmap.Downsampler.decode(Downsampler.java:179)
W      at com.bumptech.glide.load.resource.bitmap.StreamBitmapDecoder.decode(StreamBitmapDecoder.java:41)
W      at com.bumptech.glide.load.resource.bitmap.StreamBitmapDecoder.decode(StreamBitmapDecoder.java:18)
W      at com.bumptech.glide.load.resource.bitmap.ImageVideoBitmapDecoder.decode(ImageVideoBitmapDecoder.java:38)
W      at com.bumptech.glide.load.resource.bitmap.ImageVideoBitmapDecoder.decode(ImageVideoBitmapDecoder.java:19)
W      at com.bumptech.glide.load.resource.gifbitmap.GifBitmapWrapperResourceDecoder.decode(GifBitmapWrapperResourceDecoder.java:55)
W      at com.bumptech.glide.load.resource.gifbitmap.GifBitmapWrapperResourceDecoder.decode(GifBitmapWrapperResourceDecoder.java:20)
W      at com.bumptech.glide.load.engine.SourceResourceRunner.decodeFromSource(SourceResourceRunner.java:180)
W      at com.bumptech.glide.load.engine.SourceResourceRunner.runWrapped(SourceResourceRunner.java:141)
W      at com.bumptech.glide.load.engine.SourceResourceRunner.run(SourceResourceRunner.java:123)
W      at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:390)
W      at java.util.concurrent.FutureTask.run(FutureTask.java:234)
W      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1080)
W      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:573)
W      at java.lang.Thread.run(Thread.java:841)
W      at com.bumptech.glide.load.engine.executor.FifoPriorityThreadPoolExecutor$DefaultThreadFactory$1.run(FifoPriorityThreadPoolExecutor.java:52)
skia  D  ---- read threw an exception
D  --- decoder-&gt;decode returned false
</code></pre></div>
<p dir="auto">Is there anywork around for it ?</p>
<p dir="auto">It appears they aren't passed back to the request which leads to verbose logging and means the exception listener isn't called and the error drawable isn't set.</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="W/GifResourceDecoder( 1250): Error reading data from stream
W/GifResourceDecoder( 1250): java.net.SocketTimeoutException
W/GifResourceDecoder( 1250): at java.net.PlainSocketImpl.read(PlainSocketImpl.java:491)
W/GifResourceDecoder( 1250): at java.net.PlainSocketImpl.access$000(PlainSocketImpl.java:46)
W/GifResourceDecoder( 1250): at java.net.PlainSocketImpl$PlainSocketInputStream.read(PlainSocketImpl.java:240)
W/GifResourceDecoder( 1250): at java.io.BufferedInputStream.read(BufferedInputStream.java:283)
W/GifResourceDecoder( 1250): at com.android.okhttp.internal.http.HttpTransport$FixedLengthInputStream.read(HttpTransport.java:386)
W/GifResourceDecoder( 1250): at java.io.InputStream.read(InputStream.java:162)
W/GifResourceDecoder( 1250): at com.bumptech.glide.load.resource.bitmap.RecyclableBufferedInputStream.fillbuf(RecyclableBufferedInputStream.java:126)
W/GifResourceDecoder( 1250): at com.bumptech.glide.load.resource.bitmap.RecyclableBufferedInputStream.read(RecyclableBufferedInputStream.java:308)
W/GifResourceDecoder( 1250): at com.bumptech.glide.load.resource.gif.GifResourceDecoder.inputStreamToBytes(GifResourceDecoder.java:70)
W/GifResourceDecoder( 1250): at com.bumptech.glide.load.resource.gif.GifResourceDecoder.decode(GifResourceDecoder.java:39)
W/GifResourceDecoder( 1250): at com.bumptech.glide.load.resource.gif.GifResourceDecoder.decode(GifResourceDecoder.java:23)
W/GifResourceDecoder( 1250): at com.bumptech.glide.load.resource.gifbitmap.GifBitmapWrapperResourceDecoder.decode(GifBitmapWrapperResourceDecoder.java:46)
W/GifResourceDecoder( 1250): at com.bumptech.glide.load.resource.gifbitmap.GifBitmapWrapperResourceDecoder.decode(GifBitmapWrapperResourceDecoder.java:20)
W/GifResourceDecoder( 1250): at com.bumptech.glide.load.engine.SourceResourceRunner.decodeFromSource(SourceResourceRunner.java:177)
W/GifResourceDecoder( 1250): at com.bumptech.glide.load.engine.SourceResourceRunner.run(SourceResourceRunner.java:126)
W/GifResourceDecoder( 1250): at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:422)
W/GifResourceDecoder( 1250): at java.util.concurrent.FutureTask.run(FutureTask.java:237)
W/GifResourceDecoder( 1250): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
W/GifResourceDecoder( 1250): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
W/GifResourceDecoder( 1250): at java.lang.Thread.run(Thread.java:841)
W/GifResourceDecoder( 1250): at com.bumptech.glide.load.engine.executor.FifoPriorityThreadPoolExecutor$DefaultThreadFactory$1.run(FifoPriorityThreadPoolExecutor.java:46)
W/GifHeaderParser( 1250): Error Reading Block
W/GifHeaderParser( 1250): java.nio.BufferUnderflowException
W/GifHeaderParser( 1250): at java.nio.Buffer.checkGetBounds(Buffer.java:177)
W/GifHeaderParser( 1250): at java.nio.ByteArrayBuffer.get(ByteArrayBuffer.java:108)
W/GifHeaderParser( 1250): at com.bumptech.glide.gifdecoder.GifHeaderParser.readBlock(GifHeaderParser.java:397)
W/GifHeaderParser( 1250): at com.bumptech.glide.gifdecoder.GifHeaderParser.skipBitmapData(GifHeaderParser.java:311)
W/GifHeaderParser( 1250): at com.bumptech.glide.gifdecoder.GifHeaderParser.readBitmap(GifHeaderParser.java:172)
W/GifHeaderParser( 1250): at com.bumptech.glide.gifdecoder.GifHeaderParser.readContents(GifHeaderParser.java:67)
W/GifHeaderParser( 1250): at com.bumptech.glide.gifdecoder.GifHeaderParser.parseHeader(GifHeaderParser.java:47)
W/GifHeaderParser( 1250): at com.bumptech.glide.load.resource.gif.GifResourceDecoder.decode(GifResourceDecoder.java:40)
W/GifHeaderParser( 1250): at com.bumptech.glide.load.resource.gif.GifResourceDecoder.decode(GifResourceDecoder.java:23)
W/GifHeaderParser( 1250): at com.bumptech.glide.load.resource.gifbitmap.GifBitmapWrapperResourceDecoder.decode(GifBitmapWrapperResourceDecoder.java:46)
W/GifHeaderParser( 1250): at com.bumptech.glide.load.resource.gifbitmap.GifBitmapWrapperResourceDecoder.decode(GifBitmapWrapperResourceDecoder.java:20)
W/GifHeaderParser( 1250): at com.bumptech.glide.load.engine.SourceResourceRunner.decodeFromSource(SourceResourceRunner.java:177)
W/GifHeaderParser( 1250): at com.bumptech.glide.load.engine.SourceResourceRunner.run(SourceResourceRunner.java:126)
W/GifHeaderParser( 1250): at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:422)
W/GifHeaderParser( 1250): at java.util.concurrent.FutureTask.run(FutureTask.java:237)
W/GifHeaderParser( 1250): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
W/GifHeaderParser( 1250): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
W/GifHeaderParser( 1250): at java.lang.Thread.run(Thread.java:841)
W/GifHeaderParser( 1250): at com.bumptech.glide.load.engine.executor.FifoPriorityThreadPoolExecutor$DefaultThreadFactory$1.run(FifoPriorityThreadPoolExecutor.java:46)"><pre class="notranslate"><code class="notranslate">W/GifResourceDecoder( 1250): Error reading data from stream
W/GifResourceDecoder( 1250): java.net.SocketTimeoutException
W/GifResourceDecoder( 1250): at java.net.PlainSocketImpl.read(PlainSocketImpl.java:491)
W/GifResourceDecoder( 1250): at java.net.PlainSocketImpl.access$000(PlainSocketImpl.java:46)
W/GifResourceDecoder( 1250): at java.net.PlainSocketImpl$PlainSocketInputStream.read(PlainSocketImpl.java:240)
W/GifResourceDecoder( 1250): at java.io.BufferedInputStream.read(BufferedInputStream.java:283)
W/GifResourceDecoder( 1250): at com.android.okhttp.internal.http.HttpTransport$FixedLengthInputStream.read(HttpTransport.java:386)
W/GifResourceDecoder( 1250): at java.io.InputStream.read(InputStream.java:162)
W/GifResourceDecoder( 1250): at com.bumptech.glide.load.resource.bitmap.RecyclableBufferedInputStream.fillbuf(RecyclableBufferedInputStream.java:126)
W/GifResourceDecoder( 1250): at com.bumptech.glide.load.resource.bitmap.RecyclableBufferedInputStream.read(RecyclableBufferedInputStream.java:308)
W/GifResourceDecoder( 1250): at com.bumptech.glide.load.resource.gif.GifResourceDecoder.inputStreamToBytes(GifResourceDecoder.java:70)
W/GifResourceDecoder( 1250): at com.bumptech.glide.load.resource.gif.GifResourceDecoder.decode(GifResourceDecoder.java:39)
W/GifResourceDecoder( 1250): at com.bumptech.glide.load.resource.gif.GifResourceDecoder.decode(GifResourceDecoder.java:23)
W/GifResourceDecoder( 1250): at com.bumptech.glide.load.resource.gifbitmap.GifBitmapWrapperResourceDecoder.decode(GifBitmapWrapperResourceDecoder.java:46)
W/GifResourceDecoder( 1250): at com.bumptech.glide.load.resource.gifbitmap.GifBitmapWrapperResourceDecoder.decode(GifBitmapWrapperResourceDecoder.java:20)
W/GifResourceDecoder( 1250): at com.bumptech.glide.load.engine.SourceResourceRunner.decodeFromSource(SourceResourceRunner.java:177)
W/GifResourceDecoder( 1250): at com.bumptech.glide.load.engine.SourceResourceRunner.run(SourceResourceRunner.java:126)
W/GifResourceDecoder( 1250): at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:422)
W/GifResourceDecoder( 1250): at java.util.concurrent.FutureTask.run(FutureTask.java:237)
W/GifResourceDecoder( 1250): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
W/GifResourceDecoder( 1250): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
W/GifResourceDecoder( 1250): at java.lang.Thread.run(Thread.java:841)
W/GifResourceDecoder( 1250): at com.bumptech.glide.load.engine.executor.FifoPriorityThreadPoolExecutor$DefaultThreadFactory$1.run(FifoPriorityThreadPoolExecutor.java:46)
W/GifHeaderParser( 1250): Error Reading Block
W/GifHeaderParser( 1250): java.nio.BufferUnderflowException
W/GifHeaderParser( 1250): at java.nio.Buffer.checkGetBounds(Buffer.java:177)
W/GifHeaderParser( 1250): at java.nio.ByteArrayBuffer.get(ByteArrayBuffer.java:108)
W/GifHeaderParser( 1250): at com.bumptech.glide.gifdecoder.GifHeaderParser.readBlock(GifHeaderParser.java:397)
W/GifHeaderParser( 1250): at com.bumptech.glide.gifdecoder.GifHeaderParser.skipBitmapData(GifHeaderParser.java:311)
W/GifHeaderParser( 1250): at com.bumptech.glide.gifdecoder.GifHeaderParser.readBitmap(GifHeaderParser.java:172)
W/GifHeaderParser( 1250): at com.bumptech.glide.gifdecoder.GifHeaderParser.readContents(GifHeaderParser.java:67)
W/GifHeaderParser( 1250): at com.bumptech.glide.gifdecoder.GifHeaderParser.parseHeader(GifHeaderParser.java:47)
W/GifHeaderParser( 1250): at com.bumptech.glide.load.resource.gif.GifResourceDecoder.decode(GifResourceDecoder.java:40)
W/GifHeaderParser( 1250): at com.bumptech.glide.load.resource.gif.GifResourceDecoder.decode(GifResourceDecoder.java:23)
W/GifHeaderParser( 1250): at com.bumptech.glide.load.resource.gifbitmap.GifBitmapWrapperResourceDecoder.decode(GifBitmapWrapperResourceDecoder.java:46)
W/GifHeaderParser( 1250): at com.bumptech.glide.load.resource.gifbitmap.GifBitmapWrapperResourceDecoder.decode(GifBitmapWrapperResourceDecoder.java:20)
W/GifHeaderParser( 1250): at com.bumptech.glide.load.engine.SourceResourceRunner.decodeFromSource(SourceResourceRunner.java:177)
W/GifHeaderParser( 1250): at com.bumptech.glide.load.engine.SourceResourceRunner.run(SourceResourceRunner.java:126)
W/GifHeaderParser( 1250): at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:422)
W/GifHeaderParser( 1250): at java.util.concurrent.FutureTask.run(FutureTask.java:237)
W/GifHeaderParser( 1250): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
W/GifHeaderParser( 1250): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
W/GifHeaderParser( 1250): at java.lang.Thread.run(Thread.java:841)
W/GifHeaderParser( 1250): at com.bumptech.glide.load.engine.executor.FifoPriorityThreadPoolExecutor$DefaultThreadFactory$1.run(FifoPriorityThreadPoolExecutor.java:46)
</code></pre></div>