Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • A AndroidAsync
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 333
    • Issues 333
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 19
    • Merge requests 19
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Koushik Dutta
  • AndroidAsync
  • Issues
  • #487
Closed
Open
Issue created Oct 04, 2016 by TeunVR@TeunVRContributor

AsyncServer blocks in getAllByName

When the application is connected to a router without (working) internet connection, AsyncServer.getAllByName can block for 20s due to unreachable DNS. When this happens it also blocks the selector.wakeupOnce from the AsyncServer.wakeup function. Probably due to the fact that they use the same synchronousWorkers ExecutorService.

I made a workaround where I use a separate executorservice for the DNS resolve and it seems to work. However I cannot completely see the consequences of this change.

Usecase: App connects to a device on the local network directly using it's ip-address. At the same time the app tries to connect to our backend using the hostname. However, the app is connected to a router without internet connection, so the hostname cannot be resolved. This blocks the connection to the device on the local network.

It can also be reproduced by starting an emulator with an unreachable DNS: emulator -avd Nexus_5X_API_24_x86 -dns-server 192.168.1.30 (for example).

I have attached a demo-project to reproduce this issue. If you run this on the emulator with unreachable DNS you can see in the logcat that when you click 'Unresolved' it will block the 'IP Direct' call for 20s. IonLock.zip

Assignee
Assign to
Time tracking