Uploaded image for project: 'Realm Kotlin'
  1. Realm Kotlin
  2. RKOTLIN-321

[macOS] io.ktor:ktor-client-curl causes sporadic network failures

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: Sync
    • Labels:
      None

      Our Ktor network implementation seems to have issues on macOS.

      This can be reproduced 100% using our KtorNetworkTransportTest.requestSuccessful(). This test that we successfully can use all HTTP methods: GET, POST, PATCH, PUT, DELETE

      Observations:

      • The order matter. With the above order, PUT and DELETE starts to fail with ClientRequestException
      • If I change the order and test PUT first, it works.
      • When creating the Ktor HttpClient for each request it works.

      Hypothesis:

      • It is either related to some state inside Ktor not being correctly cleaned up. Either because we are misusing the API somehow, or because of a bug in Ktor. Unclear how to investigate this.
      • It is related to the HttpClient being frozen. We should be able to verify this by using a single-threaded dispatcher and create the client inside that the first time.

      Work-around:

      • Create a new HttpClient for each HttpRequest.

            Assignee:
            Unassigned Unassigned
            Reporter:
            unitosyncbot Unito Sync Bot
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: