Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Volley keeps timing out after a period of time. #277

Closed
Salim1993 opened this issue Jun 24, 2019 · 7 comments
Closed

Volley keeps timing out after a period of time. #277

Salim1993 opened this issue Jun 24, 2019 · 7 comments

Comments

@Salim1993
Copy link

Volley keeps throwing TimeoutError after keeping the app on for 3-4 hours. Once I reach this time duration, it seems that any api I use just timeouts out and doesn't even reach our server.

I've setup our apis to have a a max timeout duration of 20 seconds. Most networking calls form what I've seen takes about less then 6 seconds to complete and send back to the app. From this I believe that we have more than enough time to send the api to the serve.

From what I've seen from testing s that I believe that the networking are not even being sent from the device. Only way I've fixed it is by closing and reopening the app. We are trying to fix this issue, so that the users do not have to close and reopen the app, to fix the networking on the app.

If you need more info, let me know.

@jpd236
Copy link
Collaborator

jpd236 commented Jun 24, 2019

I'm not aware of any known issues on the Volley side here.

Things that could help us diagnose the problem:

  • A small sample app that reproduces the problem and/or demonstrates how you have integrated with Volley
  • Information about the impacted devices, Android versions, version of Volley you are using
  • An Android bugreport / thread dump taken when the app is in this condition, since it sounds perhaps like some networking threads might be hanging?

@Salim1993
Copy link
Author

Thank for the response. I will try to get the some bug reports when the app is the condition, and will post ig back here.

@Salim1993
Copy link
Author

Also im using volley: 'com.android.volley:volley:1.1.1'

@Salim1993
Copy link
Author

I've seen this happen on multiple android devices with version such as 6.0, 8.0, 9.0

@Salim1993
Copy link
Author

@jpd236 Here is one of the bug reports for when the app enters the state if mentioned above.

bugreport-sailfish-PQ3A.190605.003-2019-06-26-16-27-42.zip

@Salim1993
Copy link
Author

another bug report from another device.

bugreport-2019-06-27-09-25-31.zip

@jpd236
Copy link
Collaborator

jpd236 commented Jun 27, 2019

Looking at the first bugreport, I see three packages which are using Volley. I don't know which one(s) are related to your code:

com.digitalfractal.app
com.digitalfractal.taxidriver.debug
com.digitalfractal.drivertaxi.debug

In each case, I can see that both the CacheDispatcher thread as well as at least one of the NetworkDispatcher threads is idle and waiting for tasks. For example, for the first process:

"Thread-9" prio=5 tid=39 Waiting
  | group="main" sCount=1 dsCount=0 flags=1 obj=0x136820d8 self=0x7d4cdd3000
  | sysTid=2095 nice=10 cgrp=default sched=0/0 handle=0x7d32fff4f0
  | state=S schedstat=( 4459010 2064426 17 ) utm=0 stm=0 core=1 HZ=100
  | stack=0x7d32efc000-0x7d32efe000 stackSize=1041KB
  | held mutexes=
  at java.lang.Object.wait(Native method)
  - waiting on <0x01e5b7bd> (a java.lang.Object)
  at java.lang.Thread.parkFor$(Thread.java:2137)
  - locked <0x01e5b7bd> (a java.lang.Object)
  at sun.misc.Unsafe.park(Unsafe.java:358)
  at java.util.concurrent.locks.LockSupport.park(LockSupport.java:190)
  at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2059)
  at java.util.concurrent.PriorityBlockingQueue.take(PriorityBlockingQueue.java:548)
  at com.android.volley.CacheDispatcher.processRequest(CacheDispatcher.java:118)
  at com.android.volley.CacheDispatcher.run(CacheDispatcher.java:97)

"Thread-10" prio=5 tid=40 Waiting
  | group="main" sCount=1 dsCount=0 flags=1 obj=0x13682418 self=0x7d4cdd3c00
  | sysTid=2096 nice=10 cgrp=default sched=0/0 handle=0x7d32ef94f0
  | state=S schedstat=( 12295940 4256457 37 ) utm=0 stm=0 core=3 HZ=100
  | stack=0x7d32df6000-0x7d32df8000 stackSize=1041KB
  | held mutexes=
  at java.lang.Object.wait(Native method)
  - waiting on <0x05f901b2> (a java.lang.Object)
  at java.lang.Thread.parkFor$(Thread.java:2137)
  - locked <0x05f901b2> (a java.lang.Object)
  at sun.misc.Unsafe.park(Unsafe.java:358)
  at java.util.concurrent.locks.LockSupport.park(LockSupport.java:190)
  at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2059)
  at java.util.concurrent.PriorityBlockingQueue.take(PriorityBlockingQueue.java:548)
  at com.android.volley.NetworkDispatcher.processRequest(NetworkDispatcher.java:110)
  at com.android.volley.NetworkDispatcher.run(NetworkDispatcher.java:90)

If things are hanging, I don't see any evidence that it's Volley related, rather than something internal to your application. I'd recommend digging further into where exactly the requests are being dropped when the device enters this state.

I do see another thread in the .taxidriver.debug app which might be hung on a network call:

"Thread-73" daemon prio=5 tid=59 Native
  | group="main" sCount=1 dsCount=0 flags=1 obj=0x13dc0560 self=0x7d360a9c00
  | sysTid=18546 nice=0 cgrp=default sched=0/0 handle=0x7d2c9ff4f0
  | state=S schedstat=( 1935806579 14396740831 6432 ) utm=138 stm=54 core=2 HZ=100
  | stack=0x7d2c8fc000-0x7d2c8fe000 stackSize=1041KB
  | held mutexes=
  kernel: (couldn't read /proc/self/task/18546/stack)
  native: #00 pc 0000000000070e34  /system/lib64/libc.so (__ppoll+8)
  native: #01 pc 000000000002b814  /system/lib64/libc.so (poll+88)
  native: #02 pc 0000000000030868  /system/lib64/libjavacrypto.so (sslSelect(_JNIEnv*, int, _jobject*, conscrypt::AppData*, int)+248)
  native: #03 pc 0000000000030d14  /system/lib64/libjavacrypto.so (sslRead(_JNIEnv*, ssl_st*, _jobject*, _jobject*, char*, int, conscrypt::SslError*, int)+824)
  native: #04 pc 0000000000026a74  /system/lib64/libjavacrypto.so (NativeCrypto_SSL_read(_JNIEnv*, _jclass*, long, _jobject*, _jobject*, _jobject*, _jbyteArray*, int, int, int)+684)
  at com.android.org.conscrypt.NativeCrypto.SSL_read(Native method)
  at com.android.org.conscrypt.NativeSsl.read(NativeSsl.java:399)
  at com.android.org.conscrypt.ConscryptFileDescriptorSocket$SSLInputStream.read(ConscryptFileDescriptorSocket.java:546)
  - locked <0x0f285aea> (a java.lang.Object)
  at java.io.InputStream.read(InputStream.java:101)
  at com.pusher.java_websocket.client.WebSocketClient.run(WebSocketClient.java:183)
  at java.lang.Thread.run(Thread.java:764)

But that's not related to Volley. Maybe you should look into that.

Please reopen if you find more evidence that this is Volley related.

@jpd236 jpd236 closed this as completed Jun 27, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants