Bug #3379
mDNS/Bonjour resolution is sometimes very slow
Status: | Feedback | Start date: | 05/16/2014 | |
---|---|---|---|---|
Priority: | Normal | Due date: | ||
Assignee: | hans | % Done: | 0% | |
Category: | - | |||
Target version: | swap repos with Bluetooth and Bonjour | |||
Component: |
Description
I'm using 0.68-test now and also experienced this on the last stable version. I have a repo served via lighttpd on the same LAN and a local repo enabled on a device also on the LAN, yet when I press Repositories > Overflow Menu > Local repos the circle keeps going for ever and nothing is ever found.
Also the dialog is destroyed on rotation.
Related issues
Associated revisions
replace Android NSD browsing with jmdns
Android's NSD is only included in Android >= 16, and seems to be buggy. So
This replaces the NSD code entirely with jmdns, which works on all Android
versions.
fixes #2900 https://dev.guardianproject.info/issues/2900
fixes #3379 https://dev.guardianproject.info/issues/3379
new tricks to improve mDNS/Bonjour resolution
Before, it didn't seem to find anything unless I ran this on my laptop:
`avahi-browse -a -v`
So added two recommended practices from other jmdns code for Android:
- force full resolution on receiving serviceAdded()
- feed the WiFi's IP address to jmdns when creating an instance
History
#1 Updated by hans over 3 years ago
- Target version set to implement swap UI
#2 Updated by hans over 3 years ago
- Target version changed from implement swap UI to swap repos with Bluetooth and Bonjour
#3 Updated by Anonymous over 3 years ago
- Status changed from New to Resolved
Applied in changeset fdroidclient|commit:f2994b0764b53c4c103b94196a8719bcc57e6131.
#4 Updated by daithib8 over 3 years ago
Still not working: tested with stock Nexus 7 as host and recent OmniRom as slave.
#5 Updated by hans over 3 years ago
- Status changed from Resolved to In Progress
- Assignee set to hans
@daithib8 can you help me narrow it down? You can create a mDNS Bonjour advertisement and listen for mDNS broadcasts using avahi, if you are on GNU/Linux:
avahi-publish-service FAKER _https._tcp. 8888 type=fdroidrepos
avahi-browse -a -v
#6 Updated by daithib8 over 3 years ago
on opensuse I only have avahi-autoipd avahi-daemon avahi-dnsconfd
#7 Updated by daithib8 over 3 years ago
Sorry, avahi-utils should provide it.
Server version: avahi 0.6.31; Host name: linux-hpcr.local
E Ifce Prot Name Type Domain
+ wlan0 IPv4 FAKER Secure Web Site local
: Cache exhausted
+ wlan0 IPv4 linux-hpcr SFTP File Transfer local
+ wlan0 IPv4 linux-hpcr [00:26:82:f0:91:7d] Workstation local
+ wlan0 IPv4 linux-hpcr Remote Disk Management local
+ wlan0 IPv4 linux-hpcr SSH Remote Terminal local
+ wlan0 IPv4 donkey-Aspire-R3610 Remote Disk Management local
+ wlan0 IPv4 donkey-Aspire-R3610 [90:fb:a6:83:eb:ec] Workstation local
: All for now
My machine with lighttpd is linux-hpcr
#8 Updated by daithib8 over 3 years ago
Hmm, the discovery of local repos picks up Android-based repos now. It lists generic-LG-etc Hosted@/fe80::....., but the dialog never completes. It also lists repos on the same device that's doing the scanning.
#9 Updated by hans over 3 years ago
- Subject changed from Local repos not getting discovered to mDNS/Bonjour resolution is sometimes very slow
It does seem to take a long time sometimes.
#10 Updated by daithib8 over 3 years ago
It picked it up instantly this time. It's strange: the p990/CM and a500/Omni were picking each other up, but the Nexus wasn't. Then I ran avahi and the Nexus started to pick up the repos (immediately). I turned off Avahi, and I have each of them detecting each other. So I guess, it can be marked as resolved :-)
However, after figuring out one has to press it, when I refresh the repos, no index is downloaded.
#11 Updated by hans over 3 years ago
Strange... that mirrors my experience too. It seems that avahi's broadcast is unfreezing FDroid's jmdns...
#12 Updated by Anonymous over 3 years ago
- Status changed from In Progress to Resolved
Applied in changeset fdroidclient|commit:b0c27869b6f9910de3132f617181226a6f8652c2.
#13 Updated by hans over 3 years ago
- Status changed from Resolved to Feedback
Is this still an issue? I think its working better for me.
#14 Updated by daithib8 over 3 years ago
Doesn't seem to be much better, sorry. When I run Avahi now, I get a local repo call FAKER (Hosted @/192.168.1.115:8888)
Also I got a crash after some time, probably related to crappy WiFi:
D/InstantUploadBroadcastReceiver( 7566): Received: android.net.conn.CONNECTIVITY_CHANGE
D/InstantUploadBroadcastReceiver( 7566): Instant upload disabled, abording uploading
D/dalvikvm(32344): GC_CONCURRENT freed 410K, 14% free 3088K/3572K, paused 6ms+3ms, total 37ms
W/t$DefaultImplementation( 7283): Wait for canceled timed out: DNS: fe80::e2b9:a5ff:fe8b:a45f%wlan0.local. [fe80::e2b9:a5ff:fe8b:a45f%wlan0/fe80::e2b9:a5ff:fe8b:a45f%wlan0%5] state: canceling 1 task: null
W/t$DefaultImplementation( 7283): Wait for canceled timed out: DNS: fe80::e2b9:a5ff:fe8b:a45f%wlan0.local. [fe80::e2b9:a5ff:fe8b:a45f%wlan0/fe80::e2b9:a5ff:fe8b:a45f%wlan0%5] state: canceling 1 task: null
W/JmDNSImpl( 7283): fe80::e2b9:a5ff:fe8b:a45f%wlan0.local.recover() Could not recover we are Down!
I/LocalRepoService( 7283): we've been asked to stop the webserver: Thread-3224 says stop
I/LocalRepoService( 7283): we've been asked to stop the webserver: Thread-3236 says stop
W/dalvikvm( 7283): threadid=41: thread exiting with uncaught exception (group=0x41616ba8)
E/AndroidRuntime( 7283): FATAL EXCEPTION: Thread-3240
E/AndroidRuntime( 7283): Process: org.fdroid.fdroid, PID: 7283
E/AndroidRuntime( 7283): java.lang.IllegalStateException: A service information can only be registered with a single instamce of JmDNS.
E/AndroidRuntime( 7283): at javax.jmdns.impl.JmDNSImpl.registerService(JmDNSImpl.java:1005)
E/AndroidRuntime( 7283): at org.fdroid.fdroid.localrepo.LocalRepoService$5.run(LocalRepoService.java:239)
E/AndroidRuntime( 7283): at java.lang.Thread.run(Thread.java:841)
W/ActivityManager( 414): Force finishing activity org.fdroid.fdroid/.ManageRepo
D/FDroid ( 7283): Category 'All' selected.
D/CaptivePortalTracker( 414): DelayedCaptiveCheckState{ when=-2ms what=2 arg1=469 target=com.android.internal.util.StateMachine$SmHandler }
D/ConnectivityService( 414): setProvNotificationVisible: E visible=false networkType=1 extraInfo=null url=null