-
Notifications
You must be signed in to change notification settings - Fork 9
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
QACI-406 Websockets tck failure fix: Grizzly #24
QACI-406 Websockets tck failure fix: Grizzly #24
Conversation
dmatej
commented
Sep 7, 2020
•
edited
Loading
edited
- Fixes two websocket tests in TCK tests for 5.2020.5-SNAPSHOT
- Still fails one of two TrailersTests - originally failed two.
- More robust compatibility with JDK8 versions.
- build finally does not depend on QACI-406 NPN compilable by JDK8u265 patched-src-grizzly-npn#4 - grizzly npn release can be postponed.
- default is none - profile npn uses grizzly-npn-bootstrap - profile openjsse uses openjsse - versions can be overriden from command line (to compare results)
- important loggers are explicitly named in logging.properties
- moving this interface out is a breaking change
- can run with any compatible implementation, not only NPN Bootstrap - with new JDK versions after 8u250 uses it's JSSE impl by default - still can use older NPN bootstrap versions if configured - can use also other implementations (openjsse)
@@ -253,14 +253,14 @@ protected NextAction executeFilter(final FilterExecutor executor, | |||
NextAction nextNextAction; | |||
do { | |||
if (LOGGER.isLoggable(Level.FINEST)) { | |||
LOGGER.log(Level.FINE, "Execute filter. filter={0} context={1}", | |||
LOGGER.log(Level.FINE, "before filter execution. filter={0} context={1}", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Symmetric logging is easier to find/grep and to understand
@@ -171,7 +171,7 @@ | |||
<dependency> | |||
<groupId>org.glassfish.grizzly</groupId> | |||
<artifactId>grizzly-npn-api</artifactId> | |||
<version>${grizzly.alpn.version}</version> | |||
<version>${grizzly.npn.api.version}</version> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
At the start I wasn't sure which property is for which dependency.
@@ -1,12 +0,0 @@ | |||
package org.glassfish.grizzly.ssl; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cause of the TCK failure. Tyrus depends on this interface, so it must not be moved outside the SSLBaseFilter class. Breaking change.
@@ -1208,4 +1202,15 @@ public Buffer clone(final Connection connection, | |||
return originalMessage; | |||
} | |||
} | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Moved back.
@@ -36,7 +36,7 @@ | |||
* @return <tt>true</tt> if passed {@link HttpContent} is a <tt>HttpTrailder</tt>. | |||
*/ | |||
public static boolean isTrailer(HttpContent httpContent) { | |||
return HttpTrailer.class.isAssignableFrom(httpContent.getClass()); | |||
return httpContent != null && HttpTrailer.class.isAssignableFrom(httpContent.getClass()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
More robust. Possible NPE fixed.
</dependencies> | ||
|
||
<profiles> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Possible to use alternatives, but default is JDK version, not npn.
It is not even a breaking change, because the bootstrap was created to fill the gap for JDK8 versions without ALPN support and it is an old copy of Sun jsse classes, which were enhanced and backported back to JDK8 from JDK9/11.
private static final Method nativeHandshakeMethod; | ||
|
||
static { | ||
boolean isExtensionFound = false; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When I started to test combinations of JDK vs. grizzly vs. npn-bootstrap vs. npn-api, AlpnSupport sometimes threw exceptions on unexpected places. See Confluence page for few details.
Finally, I created a new class for all this heuristic and tested it against all JDK8 versions I have (both AdoptJDK and Zulu 8u265 are the newest)
@@ -25,7 +25,6 @@ | |||
import java.util.List; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Grizzly's tests were failing because of this class. I was able to fix one of two failing tests, but then I noticed that the lock usages are not always correct and is hard to find all paths. So I did around 100 small iterations to make the code more readable and to fix both tests.
* @author Alexey Stashok | ||
*/ | ||
public abstract class AbstractHttp2Test { | ||
static { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Logging in tests, so you can see order of method executions in multithreaded tests.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Have you tested for regressions against PAYARA-3031?
Nope, but I will add the reproducer to Payara Samples now. I have seen your 2 years old fix now, now I'm curious if it still works or not. But those locks before both our changes were used incorrectly. |
- in this state grizzly: - still fails TrailersTest (grizzly-http2) - passes TCK tests (websocket) (THIS CHANGED!) - fails h2spec (race condition) - fails LargeResponseTest (Payara Samples - http2, race condition) - see lines with FIXME: this causes data corruption!
- fixed ALPN support - fixed two failing tests (trailers) - better compatibility and logging
566f2e8
to
bb55a72
Compare
SNAPSHOT version missed in version update commit
I've pushed a minor update to the bom version - worth remembering in future that the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like a good change - make sure to push upstream when you get a chance