Status Update
Comments
do...@gmail.com <do...@gmail.com> #2
Branch: androidx-master-dev
commit b90079595f33f58fece04026a97faa0d243acdb1
Author: Yuichi Araki <yaraki@google.com>
Date: Wed Sep 18 16:55:49 2019
Change the way to detect mismatch between POJO and query
This fixes cursor mismatch warnings with expandProjection.
Bug: 140759491
Test: QueryMethodProcessorTest
Change-Id: I7659002e5e0d1ef60fc1af2a625c0c36da0664d8
M room/compiler/src/main/kotlin/androidx/room/processor/QueryMethodProcessor.kt
M room/compiler/src/main/kotlin/androidx/room/solver/TypeAdapterStore.kt
M room/compiler/src/main/kotlin/androidx/room/solver/query/result/PojoRowAdapter.kt
M room/compiler/src/test/kotlin/androidx/room/processor/QueryMethodProcessorTest.kt
M room/compiler/src/test/kotlin/androidx/room/testing/TestProcessor.kt
ml...@google.com <ml...@google.com>
bo...@google.com <bo...@google.com>
wd...@google.com <wd...@google.com> #3
do...@gmail.com <do...@gmail.com> #4
Branch: androidx-master-dev
commit bdde5a1a970ddc9007b28de4aa29d60ffa588f08
Author: Yigit Boyar <yboyar@google.com>
Date: Thu Apr 16 16:47:05 2020
Re-factor how errors are dismissed when query is re-written
This CL changes how we handle errors/warnings if query is
re-written.
There was a bug in expandProjection where we would report warnings
for things that Room already fixes automatically (
The solution to that problem (I7659002e5e0d1ef60fc1af2a625c0c36da0664d8)
solved it by deferring validating of columns until after re-write
decision is made. Unfortunately, this required changing PojoRowAdapter
to have a dummy mapping until it is validating, make it hard to use
as it does have a non-null mapping which is not useful.
This CL partially reverts that change and instead rely on the log
deferring logic we have in Context. This way, we don't need to break
the stability of PojoRowAdapter while still having the ability to
drop warnings that room fixes. This will also play nicer when we
have different query re-writing options that can use more information
about the query results.
Bug: 153387066
Bug: 140759491
Test: existing tests pass
Change-Id: I2ec967c763d33d7a3ff02c1a13c6953b460d1e5f
M room/compiler/src/main/kotlin/androidx/room/log/RLog.kt
M room/compiler/src/main/kotlin/androidx/room/processor/QueryMethodProcessor.kt
M room/compiler/src/main/kotlin/androidx/room/solver/TypeAdapterStore.kt
M room/compiler/src/main/kotlin/androidx/room/solver/query/result/PojoRowAdapter.kt
wd...@google.com <wd...@google.com> #5
VERBOSE | Found 2 DNS servers:
VERBOSE | fe80::16de:39ff:fe44:5806
VERBOSE | 192.168.1.1
It looks like emulator is trying to use fe80::16de:39ff:fe44:5806
which is the link-local address. Emulator always seem to have a problem with local addresses.
wd...@google.com <wd...@google.com> #6
Hi @maze, do you think it would make sense for emulator to switch to 2001:4860:4860::8844
when ipv6 link local address is present in the local dns config file? Apparently, there is some issue with DNS probe when the host DNS address is link local.
ma...@google.com <ma...@google.com> #7
fe80::16de:39ff:fe44:5806%eth0 (eth0 being the relevant nic)
or
fe80::16de:39ff:fe44:5806%2 (2 being the ifindex of the relevant nic)
are valid ips.
See
IFIRC many of the Linux kernel APIs (like connect(), sendto(), sendmsg(), bind()) fail when you pass in a scope-less link local IPv6 address, because they're insufficiently defined.
Furthermore link local traffic is not forwardable (simply because it's link local...)
Honestly, this feels like a network misconfiguration, as a link local DNS server is simply not reachable (without something like NAT or other hacks) from a VM, without that VM being quite literally bridged into the network (which doesn't work with normal wifi networks, as they don't support ethernet bridging) - AFAIK Android Emulator doesn't bridge (and I don't think that would work for other reasons - including that bridging would need admin privs)
Fixes in order of preference:
(a) The network should 'simply' be fixed to return a non-link local DNS IPv6 address.
(b) Make Android Studio simply ignore fe80::/64 dns servers (strip them out, you'd be left with just 192.168.1.1) - though this may end up with Android Studio networking coming up without any ipv6 connection.
(c) You could in such a case use a hardcoded DNS server - like the Google DNS ips you mentioned in #6.
However, not using the DNS provided by the system is usually something that shouldn't be done (for privacy reasons...)
As such I'd recommend doing (a) and/or (b) and perhaps adding a flag (or config option or something) to manually specify / override the DNS servers to use (perhaps one for ipv4, one for ipv6??).
To make it easier on users you could have some sort of drop down box (network provided, google dns, cloudflare dns, quad9, custom) and a field to fill in.
Note that using a global DNS resolver like Google DNS will result in local stuff (like router.lan or gateway.local) not resolving, but that's likely fine for the emulator.
(d) You could run a dns cache as part of Android Studio (and replace the link local IP with its IP), or manually forward the packets (assuming the VM even sends them out) with some NAT66 or even NAT64.
I'm including this for completeness, but I wouldn't recommend it, seems like a lot of needless complexity in the emulator.
ma...@google.com <ma...@google.com> #8
And of course ::1 or
wd...@google.com <wd...@google.com> #9
RE#7 Thanks for the detailed explanation and really appreciate the solution mentioned in
Fixes in order of preference:
(a) The network should 'simply' be fixed to return a non-link local DNS IPv6 address.
(b) Make Android Studio simply ignore fe80::/64 dns servers (strip them out, you'd be left with just 192.168.1.1) - though this may end up with Android Studio networking coming up without any ipv6 connection.
(c) You could in such a case use a hardcoded DNS server - like the Google DNS ips you mentioned in #6.
However, not using the DNS provided by the system is usually something that shouldn't be done (for privacy reasons...)
As such I'd recommend doing (a) and/or (b) and perhaps adding a flag (or config option or something) to manually specify / override the DNS servers to use (perhaps one for ipv4, one for ipv6??).
I think emulator should implement (b) at least and (c) should be only enabled if an option is provided.
do...@gmail.com <do...@gmail.com> #11
Apparently, the issue has been resolved in Android Emulator 32.1.11-9536276. After updating and restarting AS I see that network works.
However, if I run from CL, network works but log is the same for 32.1.11 with pixel 2 API 33:
VERBOSE | Found 2 DNS servers:
VERBOSE | fe80::16de:39ff:fe44:5806
VERBOSE | 192.168.1.1
wd...@google.com <wd...@google.com> #12
RE#11 Ok, let me see what has been changed from build 9456632 to build 9536276. Thanks again for the information.
wd...@google.com <wd...@google.com> #13
RE#11
I found the culprit. It's this /etc/resolve.conf
are passed into slirp instances.
In Android Emulator 32.1.11-9536276, the aforementioned CL was not cherry-picked while in emulator 31.3.15-9456632, the CL was merged. Therefore, the "problematic" link local DNS is passed into emulator 31 release but not emulator 32 release.
Solution: make sure the
go...@gmail.com <go...@gmail.com> #15
wd...@google.com <wd...@google.com> #16
RE#15 It seems like this is a different topic if you cannot install android studio on your laptop. Would you like to file a different bug?
Description
Description has been deleted.