grpc / grpc/grpc-java

AndroidChannels: failing requests right after network recovery

Offen
#5,610 17 Kommentare 5 Reaktionen 1 zugewiesene Person Beansprucht von @voidzcy Auf GitHub ansehen
android bug
Vorherrschende Sprache
Java
Sterne
12.1k
Forks
4k
Ø Merge
2 T. 17 Std.
Gemergte PRs (30 T.)
37

Beschreibung

### What version of gRPC are you using?
1.20.0

### What did you expect to see?
In our project we use android `JobService`, which starts right after device establish network connection. Inside that service we run Grpc request over `AndroidChannel`. We expect to see successful network calls at that point

### What actually happens.
Most of the time, this request fails few times in a row (as `JobService` reschedules itself on failure). At first it seems that though JobService is started, no connection is available for some reason, but then we tried to add simple http request via `OkHttpClient` - and they work well. Additional digging in logs and debugging reveals, that this might be related to `DnsNameResolver`, as it might resolve address when request is already in progress. This issue seems highly related to #4028, but occurs in AndroidChannel.

### Steps to reproduce
Given mentioned setup (JobService + AndroidChannel), it requires android device with API 24+. Issue can be reproduced by toggling off device internet connection (both WiFi and mobile, seems no difference), wait around 10-15 seconds, and toggling on connection.
Example project, which can demonstrate this issue can be found at https://github.com/AntKos/android-grpc-jobservice.

Beitragsleitfaden

Beitragsleitfaden öffnen

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.