-
Notifications
You must be signed in to change notification settings - Fork 11
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
android connection broken for too long time #278
Comments
Tried with public peers, and the error before recoverd was: mycelium::peer: Frame error from TCP 10.0.2.16:50224 <-> 65.21.231.58:9651: Connection reset by peer (os error 104) I also tried it several times before with public peers, the error was mostly this |
from my test so far:
|
i was thinking of adding some timeout mechanism, only for android. notes: Go uses timeout extensively while the engine is async, but the API is sync |
wdyt @LeeSmet ? |
Timeouts/timers are generally fine to add. Though I wonder where you'd add them. In general, the router should also detect broken connections in less than a minute, since there are Hello calls made to every peer which should get answered by an IHU (this is part of the babel protocol). So if that is also failing to reliably detect the broken connection, there seems to be something wrong there as well which needs some figuring out. |
I was thinking on the
which log that i should give attention for this? |
You're mainly looking for https://github.com/threefoldtech/mycelium/blob/master/mycelium/src/router.rs#L304 |
i've looked at this log. I'll look at the timeout way tomorrow or the day after |
Tested it again,
Croot@cilik:~# ping6 521:81b4:7f65:20c3:9a0f:2c45:8b92:5507 | ts
Jun 06 11:29:00 PING 521:81b4:7f65:20c3:9a0f:2c45:8b92:5507 (521:81b4:7f65:20c3:9a0f:2c45:8b92:5507) 56 data bytes
Jun 06 11:29:00 64 bytes from 521:81b4:7f65:20c3:9a0f:2c45:8b92:5507: icmp_seq=41 ttl=61 time=1023 ms
Jun 06 11:29:00 64 bytes from 521:81b4:7f65:20c3:9a0f:2c45:8b92:5507: icmp_seq=42 ttl=61 time=713 ms
Jun 06 11:29:02 64 bytes from 521:81b4:7f65:20c3:9a0f:2c45:8b92:5507: icmp_seq=43 ttl=61 time=943 ms
Jun 06 11:29:03 64 bytes from 521:81b4:7f65:20c3:9a0f:2c45:8b92:5507: icmp_seq=44 ttl=61 time=968 ms
Jun 06 11:29:04 64 bytes from 521:81b4:7f65:20c3:9a0f:2c45:8b92:5507: icmp_seq=45 ttl=61 time=890 ms
Jun 06 11:29:05 64 bytes from 521:81b4:7f65:20c3:9a0f:2c45:8b92:5507: icmp_seq=46 ttl=61 time=914 ms
Jun 06 11:29:06 64 bytes from 521:81b4:7f65:20c3:9a0f:2c45:8b92:5507: icmp_seq=47 ttl=61 time=938 ms i changed the log on below line to mycelium/mycelium/src/router.rs Line 295 in 15a9423
It ran every 10 seconds, but didn't detect the error (because In case of using Emulator, usually |
There are many ideas about this
|
for this, there is possibility that it was because the issue duration is still below I'm afraid i can't test it quickly because
In case of Emulator, i found that when it happened, the |
i'll check if it is half-open issue. |
I found that Android connection can sometime broken for longer time than expected.
From the code in
peers.rs
, looks like any broken connection will recover no more than 5 seconds.But sometimes i found that
ping
was broken for more than 5 minutes.What i did:
myceliumflut
on Android emulator on laptopsleep
the android by pressing thepower
buttonping side, with timestamp
and from the android side
(it is picture because android log doesn't have timestamp (#275) and i still cant find a way to export android plain log with timestamp from Android Studio )
From the
ping
, there are two occurences of issue:16:50:04 -16:57:09
from android side:
- android detected that
Stream to TCP .......is closed
- close peer connection
- and then reconnect to the peer
16:57:32 - 17:03:30
from android side:
-
dead_watcher.notified()
- [router] peer is dead
- close peer connection
- reconnect to the peer
So, there is possibility that:
The text was updated successfully, but these errors were encountered: