-
Type: Bug
-
Resolution: Done
-
Priority: Major - P3
-
None
-
Affects Version/s: None
-
Component/s: Sync
-
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.