Open cesarnorena opened 5 years ago
We've been experiencing this too. Any suggestions?
Us too. Any advice would be much appreciated.
Same
Based on stacktrace and TrueTimeRx source code it looks like Flowable created for a flatmap tries to emit onNext
after chain was disposed. If that's the case you could try "sweeping it under the rug" by using RxJavaPlugins.onError
Ref. https://github.com/ReactiveX/RxJava/issues/4880
I believe I've found the issue. Inside SntpClient.java
and TrueTime.java
there are methods requestTime() throws IOException
which are responsible for whole connection magic. In the one from SntpClient.java
you can see:
catch (Exception e) {
TrueLog.d(TAG, "---- SNTP request failed for " + ntpHost);
throw e;
}
After checking Android docs it turns out that ErrnoException
doesn't extends IOException
and that is causing the crashes because TrueTimeRx
wraps call to requestTime()
and only expects to catch IOExpcetions
. Any other exception is pushed forward to RxJavaPlugins.onError()
to be handled which by default crashes as of RxJava2.
I think changing requestTime() throws IOException
to requestTime() throws Exception
( or even Throwable) should solve issue. I'd try to submit PR with this shortly.
I'm not sure the requestTime()
is capable of throwing ErrnoExceptions - requestTime()
is calling socket.send()
, which only throws IOException
s. Sockets already catch ErrnoException
and rethrow as IOException
.
I'm afraid you are right @sixpi :( Will take a look at it once again if I found some free time. All help would be appreciated. So if you have some information don't hesitate to share
Any update on this ?
Using the
3.4
Rx version of the lib, withinitializeNtp
I get this errorandroid.system.ErrnoException sendto failed: EPERM (Operation not permitted)
. This happens with a lot of Android versions and device brands.