synchronization error while phone is asleep: failed to connect after 10000ms


  • Once in a while, I wake my phone to find an error notification from ICSx5, complaining that it failed to connect after 10000ms. This is strange because:

    • DAVx5 is also installed, and never has this problem.
    • Both ICSx5 and DAVx5 are syncing to the same reverse proxy on the same server.
    • Manual syncing always works fine.

    This is on LineageOS 17.1 (Android 10). Both the Extreme and Automatic power saver modes are disabled. ICSx5 v1.9.3

    I wonder, is it possible that ICSx5 uses different network code from DAVx5, and the former has trouble when a phone is asleep?


  • failed to connect to [server.domain.name]/[server.ip.address] (port [server.port]) from /[local.ip.address] (port [local.port]) after 10000ms
    
    java.net.SocketTimeoutException: failed to connect to [server.domain.name]/[server.ip.address] (port 34) from /[local.ip.address] (port [local.port]) after 10000ms
    at libcore.io.IoBridge.connectErrno(IoBridge.java:191)
    at libcore.io.IoBridge.connect(IoBridge.java:135)
    at java.net.PlainSocketImpl.socketConnect(PlainSocketImpl.java:142)
    at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:390)
    at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:230)
    at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:212)
    at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:436)
    at java.net.Socket.connect(Socket.java:621)
    at okhttp3.internal.platform.Platform.connectSocket(Platform.kt:120)
    at okhttp3.internal.connection.RealConnection.connectSocket(RealConnection.kt:295)
    at okhttp3.internal.connection.RealConnection.connect(RealConnection.kt:207)
    at okhttp3.internal.connection.ExchangeFinder.findConnection(ExchangeFinder.kt:226)
    at okhttp3.internal.connection.ExchangeFinder.findHealthyConnection(ExchangeFinder.kt:106)
    at okhttp3.internal.connection.ExchangeFinder.find(ExchangeFinder.kt:74)
    at okhttp3.internal.connection.RealCall.initExchange$okhttp(RealCall.kt:255)
    at okhttp3.internal.connection.ConnectInterceptor.intercept(ConnectInterceptor.kt:32)
    at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:109)
    at okhttp3.internal.cache.CacheInterceptor.intercept(CacheInterceptor.kt:95)
    at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:109)
    at okhttp3.internal.http.BridgeInterceptor.intercept(BridgeInterceptor.kt:83)
    at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:109)
    at okhttp3.internal.http.RetryAndFollowUpInterceptor.intercept(RetryAndFollowUpInterceptor.kt:76)
    at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:109)
    at okhttp3.internal.connection.RealCall.getResponseWithInterceptorChain$okhttp(RealCall.kt:201)
    at okhttp3.internal.connection.RealCall.execute(RealCall.kt:154)
    at at.bitfire.icsdroid.CalendarFetcher.fetchNetwork(CalendarFetcher.kt:129)
    at at.bitfire.icsdroid.CalendarFetcher.run(CalendarFetcher.kt:44)
    at at.bitfire.icsdroid.ProcessEventsTask.processEvents(ProcessEventsTask.kt:101)
    at at.bitfire.icsdroid.ProcessEventsTask.run(ProcessEventsTask.kt:34)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
    at java.lang.Thread.run(Thread.java:919)
    
  • admin

    @foresto yes, this is happening occasionally. It’s because ICSx5 is using the Sync Framework of Android which says “Internet is available” and tells the apps to sync although the wake-up is not completed yet, and Internet is not yet up… We can’t do much about it 😕 the best workaround is to set the sync to “one day” and pull down the screen (=trigger a sync) at a time where you commonly use your device so that it is not in a deep sleep mode.


  • @devvv4ever Why doesn’t it affect DAVx5?

  • admin

    @foresto because DAVx5 takes a bit more time to actually start the sync process which is much more complicated than ICSx5… Thus it’s almost never affected by that slight internet availibility delay


  • @devvv4ever Couldn’t ICSx5 add a small delay at the start of the sync process to work around the problem? Or add such a delay only after this error has been detected at least once?

Similar topics