RFR: 8298588: WebSockets: HandshakeUrlEncodingTest unnecessarily depends on a response body

Jaikiran Pai jpai at openjdk.org
Tue Dec 13 07:59:58 UTC 2022


On Fri, 2 Dec 2022 15:55:30 GMT, Michal Karm Babacek <duke at openjdk.org> wrote:

> According to [rfc6455](https://www.rfc-editor.org/rfc/rfc6455.html#section-5.5.1), the close frame MAY contain a body, i.e. it is considered [optional](https://www.rfc-editor.org/rfc/rfc2119#section-5). It seems that the contemporary JDK HEAD (tip) does populate the body and thus enables `HandshakeUrlEncodingTest.java` to parse its contents. On the contrary, JDK 11 does not populate the body in the same case. I would like to backport JDK-8245245 all the way to JDK 11, so I would like to change the behavior of this test so as it works across JDK versions.

Hello @Karm,

> According to [rfc6455](https://www.rfc-editor.org/rfc/rfc6455.html#section-5.5.1), the close frame MAY contain a body, i.e. it is considered [optional](https://www.rfc-editor.org/rfc/rfc2119#section-5). It seems that the contemporary JDK HEAD (tip) does populate the body and thus enables `HandshakeUrlEncodingTest.java` to parse its contents. On the contrary, JDK 11 does not populate the body in the same case. I would like to backport JDK-8245245 all the way to JDK 11, so I would like to change the behavior of this test so as it works across JDK versions.

I believe the right thing to do here, to help with the backport of this test, is to also backport the actual change/fix which populates the `HttpResponse` body. I think that fix was done as part of https://bugs.openjdk.org/browse/JDK-8240666. So backporting that fix to JDK 11 should allow you to backport even this test case to JDK 11 without any changes to this test case.

Hello Severin,


> > I believe the right thing to do here, to help with the backport of this test, is to also backport the actual change/fix which populates the `HttpResponse` body. I think that fix was done as part of https://bugs.openjdk.org/browse/JDK-8240666. So backporting that fix to JDK 11 should allow you to backport even this test case to JDK 11 without any changes to this test case.
> 
> Maybe. On the other hand, adding the response to the body of a websocket request is a _behaviour_ change, which I find questionable as to being "the right thing to do", considering we are trying to solve an encoding [bug in JDK 11](https://bugs.openjdk.org/browse/JDK-8245245) in a stable release. 

I see what you mean. In that case I think the backport process allows for the test to be updated in a way that it verifies (and passes) the actual bug fix i.e. you could do what you are proposing here, in the backport patch against the JDK 11 backport itself. My understanding is that the mainline isn't expected to take in such changes since the mainline isn't expected to be JDK version agnostic.

Having said that I think someone who's more aware of these processes will be able to provide a definitive answer. So I would recommend bringing this up in the net-dev mailing list https://mail.openjdk.org/mailman/listinfo/net-dev (this current PR hasn't triggered the official review process because of which the conversation here hasn't been copied over to the mailing list by the bots).

-------------

PR: https://git.openjdk.org/jdk/pull/11486


More information about the net-dev mailing list