Skip to content
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

Match on ClosedChannelException for EmptyStream since it's being adap… #5247

Merged
merged 2 commits into from Sep 27, 2021

Conversation

matthughes
Copy link
Contributor

…ted above.

@rossabaker
Copy link
Member

I've been chasing a lot of things. Which release did you identify the bug on? Are you running 1.0 or something earlier?

@rossabaker rossabaker added bug Determined to be a bug in http4s module:ember-client labels Sep 22, 2021
@rossabaker
Copy link
Member

I ask because we might want to cherry-pick this back to another branch. I'm expecting to run another release train this week. I don't want you or anyone else to waste time on that merge conflict if this is getting backported.

@rossabaker
Copy link
Member

Looks like at least 0.23.

@RaasAhsan
Copy link
Member

The bugfix Chris made (#5064) was merged into series/0.21, so we may want to cherrypick to there or series/0.22

.toOption
.get
val request = GET(body, uri)
EmberClientBuilder.default[IO].withIdleConnectionTime(1.seconds).build.use { client =>
Copy link
Member

@RaasAhsan RaasAhsan Sep 22, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe this is the opposite of what we want. we are interested in seeing what happens when the client timeout is longer than the server timeout i.e. what happens if the server closes their end of the connection and the client try to make another request

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also the right client configuration option to use here is withIdleTimeInPool -- idle connection time controls how much time the client will wait for a response after a request has been sent before timeout

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ugh, actually, I don't think this will test exactly what we want. At worst this will induce a connection reset by peer error which isn't what we want. I think we should just merge in the fix for now and think about how to do the test later, since none of the servers we have available let us emulate that behavior

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rossabaker Updated the PR.

@matthughes matthughes changed the base branch from main to series/0.21 September 22, 2021 12:26
@matthughes
Copy link
Contributor Author

I removed the test and targeted it to 0.21 branch. This should be ok to be cherry picked forward.

@@ -223,6 +223,7 @@ private[client] object ClientHelpers {
// case Left(EmberException.EmptyStream()) => true // Next version can be accessed by users
case Left(org.http4s.ember.core.EmptyStreamError()) =>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i'm guessing this match clause isn't necessary anymore but deferring to @ChristopherDavenport on that one

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah I wasn't sure as to whether we should keep that in there or not. It's not currently getting matched on.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks to me like it can only be raised where it has been adapted. I think it can go.

@rossabaker rossabaker merged commit a5d03df into http4s:series/0.21 Sep 27, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Determined to be a bug in http4s module:ember-client
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants