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

Java16 support #409

Merged
merged 15 commits into from
May 12, 2021
Merged

Java16 support #409

merged 15 commits into from
May 12, 2021

Conversation

Ladicek
Copy link
Contributor

@Ladicek Ladicek commented May 5, 2021

No description provided.

@Ladicek Ladicek requested a review from a team as a code owner May 5, 2021 11:38
@Ladicek
Copy link
Contributor Author

Ladicek commented May 5, 2021

Wow, macOS does seem to have a rather unprecise scheduler :-)

@Ladicek Ladicek added this to the 5.0.1 milestone May 5, 2021
@Ladicek Ladicek force-pushed the java16-support branch 2 times, most recently from 39346c0 to 441a2ac Compare May 7, 2021 15:16
@Ladicek Ladicek force-pushed the java16-support branch 4 times, most recently from f33f07b to 0ee7a49 Compare May 10, 2021 10:39
@michalszynkiewicz
Copy link
Contributor

why do we have only windows checks? That's an interesting choice ;)

@Ladicek Ladicek force-pushed the java16-support branch 3 times, most recently from a221e1e to a5a972c Compare May 10, 2021 12:09
@Ladicek
Copy link
Contributor Author

Ladicek commented May 10, 2021

Look at the latest commit, I'm doing some debugging as there's a weird failure that never happened on Linux. That commit will disappear and we'll run CI on 8, 11, 16 and 17-ea on Linux, Windows and Mac.

@Ladicek Ladicek force-pushed the java16-support branch 12 times, most recently from fc2999f to a543044 Compare May 11, 2021 08:22
@Ladicek Ladicek force-pushed the java16-support branch 3 times, most recently from e8462db to fa023a2 Compare May 11, 2021 12:38
Ladicek added 14 commits May 11, 2021 15:44
In addition to Java 8 and 11, which are currently the Java LTS
releases we care about, also run CI builds with 16 and,
after a known bug in JBoss Class File Writer is fixed, 17-ea.

The idea is that we'll run builds with all Java LTS versions
that we care about, the latest Java GA release, and currently
upcoming Java release.

This means that when Java 17 goes GA, we'll run with 8, 11, 17
and 18-ea. Note that 17 will be an LTS release, so it will
remain in the list even when 18 goes GA.

At some point, we'll also want to drop 8.

When it comes to the release build, we want to produce a MR JAR,
so we have to run the build with Java 11. Note that we still
produce a Java 8 bytecode by default.
This has two parts:
- remove useless configuration from POM, this is already configured
  in SmallRye Parent;
- make sure `<release>8</release>` is used for base layer compilation
  by creating the `build-release-8` file.
This means mainly renames and adding some javadoc.
…strategies

Since `CompletionStage` doesn't support cancellation, we don't use
thread blocking operations in `CompletionStage` strategies, and
we don't interrupt threads that run `CompletionStage` strategies,
it is worthless to try to handle interruptions. We should only
check if interruption happened in synchronous and `Future`-based
asynchronous strategies, where thread blocking operations are used.

Of course interruption may happen for another reason, but we can't
do anything about that.

This seems to be a bigger deal than it really is, because there was
only one remaining `CompletionStage`-based strategy that tried to
handle interruptions: fallback. This commit removes that handling
and also improves fallback test coverage.
Some tests rely on system time and scheduling to happen with high
accuracy. For example, we schedule a timeout to happen after 200 ms,
sleep 100 ms and then verify that timeout didn't happen yet.

These are bad unit tests for sure, but I certainly don't feel like
deleting them. Instead, let's only run them on Linux, where we know
they pass.

Another option would be to increase those times; instead of 200 ms,
we could schedule the timeout to happen after 2 seconds, and sleep
1 second instead of 100 ms. That would significantly increase
the likelihood of these tests passing, but it would also make them
much slower.
Previously, `AsyncTimeout` used the `InvocationContext` event
system to communicate with the `Timeout` strategy. This had
2 flaws in presence of retries:

- the set of event handlers grew up with each retry, resulting
  in unnecessary attempts to complete a `Future` that has already
  been completed (silly, but harmless);
- a delayed (due to thread scheduling) timeout event from one retry
  iteration could trigger immediate timeout for subsequent retry
  iteration (big problem!).

With this commit, `AsyncTimeout` and `Timeout` use
the `InvocationContext` contextual data system and don't suffer
from these issues. This is because the `Timeout` class picks up
the contextual data item that's used for communicating with
`AsyncTimeout` synchronously, so that it's always the one belonging
to the "current" retry iteration, and even deletes it immediately
after picking it up.
The `CircuitBreakerRollingWindowTest` uses a `@CircuitBreaker`
with a delay of 300 ms. It used to sleep 300 ms and then verify
that the circuit breaker state changed.

It may easily happen that the thread that's supposed to sleep
for 300 ms only sleeps for, say, 290 ms, and then obviously
the circuit breaker doesn't change state yet.

The fix in this commit is simple: increase the sleep time to 400 ms.
That should decrease the likelihood of sleeping less than 300 ms
to minimum.
@Ladicek Ladicek merged commit 9c63691 into smallrye:main May 12, 2021
@Ladicek Ladicek deleted the java16-support branch May 12, 2021 09:20
@Ladicek Ladicek linked an issue May 17, 2021 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Distribute a multi-release jar
2 participants