reactor-core v3.3.0.RELEASE Release Notes
Release Date: 2019-09-25 // over 4 years ago-
๐ Reactor-Core
3.3.0.RELEASE
is part ofDysprosium-RELEASE
Release Train.๐ This release note covers the first GA release of the 3.3.x cycle, and as such describes the changes from the perspective of a 3.2.x to 3.3.0 comparison.
๐ See also release notes from 3.2.12, 3.2.11, 3.2.10 and 3.2.9 for changes that were inherited from the 3.2.x maintenance releases.
๐ This release is a big opportunity to polish the APIs and some behaviors with less restriction than maintenance releases.
โฑ ๐ It also introduces a few new features, the highlight of which is the
BoundedElasticScheduler
:
โฑ this one has evolved from theElasticScheduler
and is intended as a future replacement for it.
โฑ A cap can be put on the number of threads such a scheduler can spawn. After that cap is reached, further task submissions are deferred (being enqueued) up to a second global limit on enqueued tasks (optionally unbounded).โก๏ธ โ ๏ธ Update considerations and deprecations
- (from RC1:)
- A few Mono operators have slightly changed their behavior in regards to how when they propagate
onNext
: they could triggeronError
afteronNext
, which is not permitted in Mono.Mono#usingWhen
now waits for the async complete handler termination before propagatingonNext
(#1832)Mono#using
similarly avoids triggering onNext+onError if cleanup fails (#1853)Mono#doOnTerminate
now acts similarly todoOnSuccess
, executing the side effect before theonNext
is propagated downstream (#1752)
- ๐
Mono#do[On|After]SuccessOrError
has been deprecated and marked for removal in 3.4 (#1854) - ๐
usingWhen
API has been polished, and some variants deprecated for removal in 3.4 (#1687)- A new overload has been introduced that uses
BiFunction
for error handler (exposing the failure that causes "rollback") - A single-handler version has been added to
Mono
for alignment withFlux
. This is the simplest case: same handler for complete, error and cancel terminations. - All other overloads have been deprecated. Goal is to favor either the simple 1-handler-covers-all case OR force users to be explicit about ALL possible terminations.
- A new overload has been introduced that uses
- (from M3:)
- ๐ #1742 Processors and Kotlin extensions deprecations
- ๐ the
WorkQueueProcessor
andTopicProcessor
have been marked as deprecated for 3.3.x and will be removed in 3.4 - ๐ have been deprecated, due to underlying use of
Unsafe
- Recommended core alternative is to combine
EmitterProcessor
andpublishOn
- ๐ the Kotlin extensions are deprecated in core and replaced by a dedicated project/repo,
reactor-kotlin-extensions
- ๐ in both cases, the deprecated classes don't appear in the generated javadoc jar
- โฑ #1764 Deprecated method
Schedulers.Factory#decorateExecutorService
has been removed - #1669 All
onBackpressureBuffer(maxSize+error)
variants now delay errors - ๐ In debug mode, most of the original stacktrace is artificially moved at the end of the exception's output, after the "backtrace" (#1781)
- ๐ #1745
compose()
has been deprecated and renamedtransformDeferred()
- ๐ deprecated operator will be removed in 3.4
- ๐ฆ #1451 Dematerialize has been reworked and now expects 1 request per upstream
Signal
- ๐ฆ This avoids
onNext
events to be emitted only when the subsequent signal is ready upstream - ๐ฆ This also means that in order to get a terminal signal like
onComplete
signal, the correspondingSignal
must be explicitly requested from upstream (one extrarequest(1)
) - (from M2:)
- Exceptions are now unwrapped (
Exceptions#unwrap
) in most sources that immediately produce an error, acting like aCallable
(b6f4d29) - ๐ Moved
reactor-tools
sources into the core repository (#1731)
๐ฑ โจ New features and improvements
- โฑ ๐ Added a
boundedElastic
Scheduler that caps number of threads and scales to 0 (#1804)- global singleton also cap deferred tasks past the thread limit to 100K (32d2a29)
- thread cap and task queue capacity can be configured separately, the later can even be unbounded
- โ Add windowUntilChanged operator, ensure the stateful predicate is subscriber-specific and cleaned on cancel (#1850, #1901)
- ๐ Improve the naming (eg.
scan(Attr.NAME)
ortoString
) of global singleton Schedulers (#1885, #1886)- for instance, instead of
parallel(parallel)
this is nowSchedulers.parallel()
- for instance, instead of
- ๐ Improvements around subscription recursivity / subscribe loop performance (#1882)
- Avoid extra lastAssembly by using CorePublisher where possible (#1883)
- (from RC1:)
- Due to a few Throwable constants, class references could leak in multi-classloader environments. This is now avoided by skipping the filling of the stacktrace (#1872)
- โ Add BufferUntilChanged operator (#1706, bb5b2bb)
- โ Added new StepVerifier API to subscribe to source and verify it later (#1848, b2ce5fe)
- (from M3:)
- โ Add "VirtualTimeScheduler#getScheduledTaskCount()" (#1746)
- #1763 Flux.parallel now uses
Schedulers.DEFAULT_POOL_SIZE
(which can be overridden by system property) - #1767 Add ParallelFlux#then to compose on parallel termination
- โฑ #1722 Make sure ElasticScheduler.CachedService gets disposed
- #1798 Use bounded wildcard in error(Supplier)
- ๐
Polish flux metrics (#1802)
- see also the other commits linked in that PR
- Actually record executor service metrics to Micrometer (#1795)
- โ Add a Context-aware {Mono,Flux}.deferWithContext (#1819)
- โก๏ธ Eliminate
subscribe
from stack by optimizing the "tail calls" (#1761, #1826) - #1416 Add lambda subscribe variants with a context
- (from M2:)
- Avoid triggering
Context
lookups in error sources (4f2bc7a) - Extended blockHound whitelist
- โ Remove unnecessary volatile with UnicastProcessor fusion (c86db5a)
- ๐ Improved cache eviction in ElasticScheduler (#1700)
- (from M1:)
- โ
Compatibility with projects using the Java Module System (JPMS) has been improved by declaring an official
Automatic-Module-Name
(reactor.core
andreactor.test
, #1641, #1692) - The
CorePublisher
interface has been introduced to distinguishPublisher
from reactor (#1527) - โ Add a simplified API for wrapping scheduled tasks (#1546)
- โ Add an API-preserving hide() method to ConnectableFlux (#1577)
- โ [reactor-test] Added hasDiscardedMatching method in StepVerifier (#1509)
- โ
[reactor-test] Add ToStringConverter and Extractor to StepVerifierOptions (#1558)
- This allows to override the natural
toString
representation of classes that are known to have an obscure representation, as well as extracting such objects that would be nested in containers like aCollection
,Tuple2
,Signal
, ...
- This allows to override the natural
- Reworked the format of "backtraces" (#1672, #1702)
- Backtraces are the additional callsite information captured by debug mode and checkpoint and appended to onError
Throwable
as a suppressed exception
- Backtraces are the additional callsite information captured by debug mode and checkpoint and appended to onError
- Reactor now integrates into Blockhound 1.0.0.M3 using the SPI on reactor side instead of programmatic explicit registration on blockhound side (#1682, #1690)
๐ฑ ๐ Bug fixes
- (from M2:)
- Avoid unbounded Flux.replay request with bounded subscribers (#1185)
- โ Removed "checkpoint" prefix in backtraces from return-only callsites (#1740)
- (from M1:)
- ๐ฆ [reactor-test] Prevent StepVerifier collect hang when consuming all signals (#1529)
- Unwrap CompletionException in Mono#fromFuture (#1652)
- ๐ Fix MonoProcessor#block duration.zero change (c995c01)
๐ ๐ Documentation, Tests and Build
- Document Java9stubs-related importing issues (#1680)
- [doc] Disambiguate lowTide example in limitRate javadoc
- Document reactor-tools in refguide (#1903)
- โ [internal test utils] Rework autoCleanup methods into a reusable JUnit Rule
- โ [internal test utils] Add direct assertion method on RetainedDetector
- (from RC1:)
- [doc] Add limitRate marble diagrams (#1449)
- ๐ [build] Polish benchmarks build, remove jmh plugin (#1844, 1ba4944)
- ๐ [build] Make it possible to run two JMH tasks - baseline and current (#1862)
- (from M3:)
- ๐ [build] Use "check" task as an aggregator, not "test" (#1776)
- ๐ [doc] #1539 Add "metrics" section to the reference guide (see also #1812, #1817)
- (from M2:)
- ๐ [build] JMH benchmarks are now in a separate sub-project, forked scrabble benchmark there (8895e94)
- ๐ [build] Log console output in Gradle ONLY for failed tests on CI (fc74beb)
- (from M1:)
- [doc] Document that BaseSubscriber instances can't be reused (#1490)
- ๐ [CI] Sanity check build on JDK12 on Travis (446ca1b)
- [doc] Use the correct marble diagram for Mono#onErrorResume (#1679)
- ๐ [build] Polish .gitignore to avoid too broad regex (92ae4e5)
๐ ๐ Thanks to the following contributors that also participated to the Dysprosium-RELEASE or pre-releases
@aftersss, @akarnokd, @apuravchauhan, @berry120, @Buzzardo, @dittos, @don-vip, @flambard, @gindex, @hisener, @izeye, @jnizet, @mumukiller, @OlegDokuka, @pcdavid, @pmackowski, @ramonPires, @szpak, @ttddyy, @UgiR, @zhouzhou19950825