长时间(〜30分钟)恢复应用时出现Lamda错误

时间:2019-05-08 12:28:36

标签: android lambda rx-java rx-java2

它不会每次都发生,但可以在2-3次尝试后重现。可能是特定于OEM的。我可以在三星,诺基亚上进行复制,但在OnePlus上无法实现。

at in.me.android.network.NetworkWrapper.lambda$null$10(NetworkWrapper.java:407)
        at in.me.android.network.-$$Lambda$NetworkWrapper$xDxT50ISS7RzIYDRy06-pFggegg.apply(Unknown Source:2)
        at io.reactivex.internal.operators.flowable.FlowableFlatMap$MergeSubscriber.onNext(FlowableFlatMap.java:132)
        at io.reactivex.internal.operators.flowable.FlowableZip$ZipCoordinator.drain(FlowableZip.java:249)
        at io.reactivex.internal.operators.flowable.FlowableZip$ZipSubscriber.onNext(FlowableZip.java:381)
        at io.reactivex.processors.UnicastProcessor.drainFused(UnicastProcessor.java:363)
        at io.reactivex.processors.UnicastProcessor.drain(UnicastProcessor.java:396)
        at io.reactivex.processors.UnicastProcessor.onNext(UnicastProcessor.java:458)
        at io.reactivex.processors.SerializedProcessor.onNext(SerializedProcessor.java:103)
        at io.reactivex.internal.operators.flowable.FlowableRepeatWhen$WhenSourceSubscriber.again(FlowableRepeatWhen.java:171)
        at io.reactivex.internal.operators.flowable.FlowableRetryWhen$RetryWhenSubscriber.onError(FlowableRetryWhen.java:76)
        at io.reactivex.internal.operators.flowable.FlowableObserveOn$BaseObserveOnSubscriber.checkTerminated(FlowableObserveOn.java:209)
        at io.reactivex.internal.operators.flowable.FlowableObserveOn$ObserveOnSubscriber.runAsync(FlowableObserveOn.java:399)
        at io.reactivex.internal.operators.flowable.FlowableObserveOn$BaseObserveOnSubscriber.run(FlowableObserveOn.java:176)
        at io.reactivex.android.schedulers.HandlerScheduler$ScheduledRunnable.run(HandlerScheduler.java:124)
        at android.os.Handler.handleCallback(Handler.java:874)
        at android.os.Handler.dispatchMessage(Handler.java:100)
        at android.os.Looper.loop(Looper.java:198)
        at android.app.ActivityThread.main(ActivityThread.java:6729)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)

发生在retryWhen块

.filter(trackOrderResponse -> trackOrderResponse != null)
            .subscribeOn(Schedulers.io())
            .observeOn(AndroidSchedulers.mainThread())
            .retryWhen(errors -> errors
                .zipWith(Flowable.range(1, 4), (n, i) -> i)
                .flatMap(retryCount -> {
                    if (retryCount <= 3) {
                        return Flowable.timer((long) Math.pow(2, retryCount), TimeUnit.SECONDS);
                    }
                    return Flowable.error(new Throwable());
                })
            )
            .repeatWhen(completed -> completed.delay(pollingInterval, TimeUnit.MILLISECONDS))
            .doOnError(throwable -> Logger.logException(TAG, throwable))
            .onErrorResumeNext(Flowable.just(new ApiResponse<TrackOrderResponseDataNew>()));

0 个答案:

没有答案