Skip to content

AHC can get completely stuck, swallowing errors #217

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
weissi opened this issue May 19, 2020 · 1 comment · Fixed by #221
Closed

AHC can get completely stuck, swallowing errors #217

weissi opened this issue May 19, 2020 · 1 comment · Fixed by #221
Assignees
Labels
kind/bug Feature doesn't work as expected.
Milestone

Comments

@weissi
Copy link
Contributor

weissi commented May 19, 2020

This snippet:

    func testErrorsAreSurfaced() {
        let httpBin = HTTPBin()
        let httpClient = HTTPClient(eventLoopGroupProvider: .shared(self.clientGroup))
        defer {
            XCTAssertNoThrow(try httpClient.syncShutdown())
            XCTAssertNoThrow(try httpBin.shutdown())
        }

        let request = try! HTTPClient.Request(url: "http://localhost:\(httpBin.port)/get",
                                              method: .POST,
                                              body: .stream { streamWriter in
            print("GOT STREAM")
            return httpClient.eventLoopGroup.next().makeSucceededFuture(())
        })
        let runningRequest = httpClient.execute(request: request)
        XCTAssertThrowsError(try runningRequest.wait()) { error in
            print(error)
        }
    }

will just get stuck indefinitely.

@weissi weissi added kind/bug Feature doesn't work as expected. ⚠️ release blocker labels May 19, 2020
@weissi weissi added this to the 1.2.0 milestone May 19, 2020
@weissi
Copy link
Contributor Author

weissi commented May 19, 2020

It tries to give (and fails) to give me an error about missing content length. Really it should probably be using transfer-encoding: chunked but that's #218. But the key thing here is to fix the error propagation, that at least has to work :'(

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Feature doesn't work as expected.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants