Releases: reactor/reactor-core
v3.2.0.M3
This is the 3rd milestone of Reactor 3.2.0, part of Californium-M1
Pre-Release Train.
This milestone contains quite a few bugfixes and improvements, but the main highlight is the introduction of a hook for cleanup of elements that either get filtered out of a sequence or are accumulated by prefetch mechanisms but never emitted (due to cancellation or error).
See #999 for discussion around this topic, feedback is welcome!
Another notable change, this time in the way we work with the repository and contributions that make sense for maintenance releases: as of commit 0d8e16e, there will be no more port #xxx
backport commits in maintenance branches, but rather issues will be fixed first in the maintenance branch THEN a forward-merge will happen to include the fix in the master
branch. See #1225.
⚠️ Update considerations and deprecations
- The constant
Schedulers.DEFAULT_POOL_SIZE
is now used internally (notably bySchedulers.[new]parallel()
), but unlike before it doesn't enforce a minimum of4
anymore. It can be tuned via system propertyreactor.schedulers.defaultPoolSize
now though (#1243, #1246) repeat(N)
is now aligned withretry(N)
, as well asrepeat(N, Predicate)
/retry(N, Predicate)
: the number indicates the amount of repetitions of the original sequence, ie0
mirrors the original sequence while1
mirrors the original sequence + an additional repetition of it. Negative values are rejected at assembly time. (#1252)- look out for usage of
repeat(long)
in your code and decrement the passed parameter by one repeat(0)
should be replaced withFlux/Mono.empty()
- look out for usage of
errorStrategyContinue()
methods from M1 have been renamed toonErrorContinue
to reuse the same prefix as other error handling methods, event though this one has a mechanism that is quite different (#1287)Flux#metrics()
from M2 has been refined, and some tags renamed (#1245, #1242, #1250)
✨ New features and improvements
- ⭐ Add
onDiscard
hook for clean disposal of elements that never make it to user code (#999) - The default
Scheduler
pool size is now configurable via a system property (#1243) Flux#metrics()
from M2 has been refined, and some tags renamed (#1245, #1242, #1250)- In the case where a
QueueSubscription
is logged vialog()
during anonNext
, itstoString
method is explicitly called (#1270)- typically this would happen when using
window()
immediately followed bylog()
, which is not really useful but was even less useful since it would trigger an exception
- typically this would happen when using
Tuple2
..Tuple8
now havemapT1
..mapT8
(as relevant) methods that allow to change a single part of theTuple
(e4a9aee, discussed in #1058)usingWhen
from M2 can now be cancelled early before the resourcePublisher
emitted, which cancels saidPublisher
. As a consequence this operator doesn't implement micro-fusion anymore (#1233)
🪲 Bug fixes
- When using a non-compliant
TestPublisher
, calling.mono()
would turn it into a compliant one. This has been fixed and the mono will now continue to be a bad boy (#1244) - A few
bufferTimeout
andbufferWhen
issues have been corrected around cancellation and drain race conditions (#1247) - The
usingWhen
operator from M2 wouldn't propagate the main sequence'sContext
to commit/rollbackPublisher
s (#1259)
📖 Documentation, Tests and Build
- ⭐ Contributing Guidelines have been totally reworked and reflect the new organisation, notably in terms of labels and branching (see highlights at the top, d166557, #1225)
- Various clarifications have been made in the javadoc, including marble diagram fixes (#1240, #1266, #1079)
- Some reference documentation error fallback snippets were wrong (#1269)
- Java 9 build has been fully reactivated now that every build component is Java 9 compatible (right on time for Java 9 EoL 😁 see 2b4bf5e, 209a45f, #896, e239d65)
- Kotlin has been bumped to
1.2.51
(#1274)
👍 Thanks to the following contributors that also participated to this release
v3.2.0.M2
MILESTONE 2 for Reactor 3.2.0, which will be the first release in the CALIFORNIUM
Release Train.
This milestone contains a lot of fixes and improvements, as well as new features we'd really like your feedback on:
📢 Feedback Wanted! New features
- Add
metrics()
toFlux
(#1183, #1123, 34e0d4b)- This operator does nothing if
Micrometer
is not on the classpath - It exposes metrics from upstream signals visible at the operator's position in the chain
- 📢 Feeback wanted on the type of metrics exposed
- This operator does nothing if
- Add exponential backoff retry with jitter to core:
retryWithBackoff
(#1122)- This version of retry reflects what we think is the industry best practice in terms of retries.
- It is a good middle ground between the too simple
retry(n)
, the complexretryWhen(Function)
and the more configurableRetryFunction
fromreactor-addons
- New operators for transactional reactive use cases:
usingWhen
(#1220, b87ea6d)- Like
using
, but the resource is provided asynchronously through aPublisher
- Can have separate async "cleanup" for complete, error and cancel terminations
- Cleanups are asynchronous as well (
Function<Resource, Publisher>
) and only delay the propagation of the terminal signals, NOT theonNext
signals.
- Like
⚠️ Update considerations and deprecations
windowUntil
andwindowWhile
don't have a final empty window at the end of the sequence (#1033)- Default behavior for
Operators.onErrorDropped
is now to both bubble and throw the errorMono.fromCompletionStage
now drops fatal exceptions rather than hanging (#1118)
- Blocking APIs (like
blockLast()
,block()
,iterator()
) called inside a parallel or singleScheduler
trigger an exception (#1102)- This kind of blocking call are harmful as they impact limited resources, with a high risk of freezing the application
concatMapDelayError
default behavior is now to delay the errors until theEND
(#1101)- This aligns with other *DelayError operators
StepVerifier.withVirtualTime
now use a global lock, making virtual time verifications mutually exclusive (#648)- Virtual time impacts schedulers at the application level. Parallelisation of tests could lead to unforeseen side effects due to this (initializing operators with a VTS and have the StepVerifier see and manipulate the wrong VTS)
create
usesOperators.onOperatorError
hook instead ofonErrorDropped
(#1078)- (deprecation)
Scannable#operatorName()
is deprecated in favor ofstepName()
(#1115, #1140) - (internal) Switch to a simplified implementation for
Mono.publish(Function)
(#437) - (internal) Simplify MonoProcessor internals in preparation for #1114 and further 3.2 changes
✨ New features and improvements
cache(Duration)
now have an overload that takes aScheduler
, addedMono.cache
TTL-generator variant (#1189, #1125)Operators.lift
now has an alternative that exposes the rawPublisher
:liftPublisher
(#1205)Operators.lift
now supportsFuseable
(#1206)- Added
zip
variants with 7 and 8 arguments (#1210 - Support 0 delay/period in
Flux.interval
(#1178) - Add immutable
empty()`` queue Supplier to
Queues, support empty and one cases in
Queues.capacity()` (#1161, d9d76ab) doOnEach
now supportFuseable
andConditionalSubscriber
(#1003)Flux.take(0)
now eagerly cancels on subscription (#1158)- Lazy
Mono#fromFuture
andMono#fromCompletionStage
added, withSupplier
param (#1131) - Add an `error(Supplier)`` variant to Flux and Mono (#1100)
- Add
Scannable#steps()
, which produces aStream<String>
of all the stepNames both upstream and downstream (including the currentScannable
) (#1115, #1140) - All operators now implement basic
Scannable
(this avoids problems for users that use instanceof checks in hooks, #1136) - [kotlin] Add
Flux.split
extension to convertFlux<List<T>>
toFlux<T>
(#1089) - [reactor-test] Add
verifyThenAssertThat(Duration)
to allow assertions and verification timeout (#1124) - [reactor-test] Allow naming of a whole StepVerifier scenario through options (#1077)
- [reactor-test] Allow to change the
LoggerFactory
with a custom implementation, provide aTestLogger
one that can be used to assert log contents (8f3a8fa) - [reactor-test] Add a cold version of the
TestPublisher
than can be set up before eg. subscribing in aStepVerifier
(#1236)
🪲 Bug fixes
Flux.last()
now correctly throws aNoSuchElementException
on empty source even when said source is aCallable Mono
(#1226)delayUntil
correctly requestLong.MAX_VALUE
and notInteger.MAX_VALUE
on subscribe (#1214)Operators.lift()
properly maintainGroupedFlux
/ConnectableFlux
interfaces (#1204)- Request is now accounted for in `FluxOnBackpressureBufferTimeout (#1194)
- onSubscribe should be done before add in MonoCacheTime.subscribe (#1190)
- Multi-subscriber operators
Context
resolution resolves to 1st context (#1114) - Fix dangling thread when calling
WorkQueueProcessor.forceShutdown
(#1142) - Let
VirtualTimeScheduler
deferadvanceTime
if queue is empty (#783)- This avoids a situation where, due to a
subscribeOn
, the operators delaying values end up reading the clock AFTER the virtual time has been moved forward bythenAwait
, hanging the test.
- This avoids a situation where, due to a
- Tweak
FluxPublish
dispose to clear the existing connection (#1173) - Avoid interrupting
WorkerTask
Future
if cancelled race (#1107) FluxRefCount
DisconnectException
on cancellation race (#1088)- (internal cleanup) use passed queue in
FluxGroupBy.checkTerminated
(#1094) - Only terminate ExecutorScheduler if underlying is shut down (#1080)
Mono.fromCompletionStage
now drops fatal exceptions rather than hanging (#1118)
📖 Documentation, Tests and Build
- Improve various marble diagrams (#1043, #1008, #1167)
- Document (im)mutability of Tuple2
toList()
vsiterator()
(#1135) - Point to reference doc operator matrix in Flux/Mono javadoc (f2bc74f)
- Warn on
doOnSubscribe
usage (#1090) - various javadoc typos and minor rephrasing (#1222, 89a8e0e, #1149, #1199, 51dff9f, 4a1f691, 4e55122, #1095, 7a6a8a1, 35cb6fd,
- Various test fixes (2f74309, 0254f45, #1139, 1c27a15, 44dc73c, 8d942e1, 38f8edb)
- Add meaningful toString to FluxSink/MonoSink implementations (#1130)
👍 Thanks to the following contributors that also participated to this release
@alex-diez, @baptistemesta, @charlesmuchene, @igoperikov, @madgnome, @OlegDokuka, @smiklos, @utwyko, @yamkazy
v3.1.8.RELEASE
This is the 9th release of Reactor 3.1, part of BISMUTH-SR10
Release Train.
This is a recommended update for all Reactor 3 users. Note that all fixes in this release
are backports of fixes in the upcoming 3.2.0.RELEASE.
⚠️ Update considerations
Flux.last()
used to skip throwing aNoSuchElementException
on some category of empty sources (Flux
orMono
that areCallable
). This is a bug and it correctly does throw now. (#1226)
✨ New features and improvements
🪲 Bug fixes
Flux.last()
throwsNoSuchElementException
(see update considerations section, #1226)Operators.lift
properly maintainGroupedFlux
/ConnectableFlux
interface (#1204)- Request is not tracked in
FluxOnBackpressureBufferTimeout
(#1194) - Let
Flux.interval
support 0 delay/period (#1178) delayUntil
now requestsLong.MAX_VALUE
instead ofInteger.MAX_VALUE
(#1214)
📖 Documentation, Tests and Build
- Fix compiler warnings during compileTestJava phase (#1139)
- Revert bad replace of word "set" with "push" in comments (#1192)
👍 Thanks to the following contributors that also participated to this release
v3.1.7.RELEASE
This is the 8th release of Reactor 3.1, part of BISMUTH-SR9
Release Train.
This maintenance update is mainly backporting QoL enhancements and fixes from the ongoing 3.2.0 development effort.
✨ New features and improvements
MonoProcessor
internals have been improved and now support Context resolution (6ab5186)- Pub-Sub operators and processors now support Context resolution (first context found) (#1114)
- Partial resolution for recursive virtual time use (#783)
Flux.take(0)
now eagerly cancel and onComplete (#1158)
🪲 Bug fixes
Mono.cache(Duration)
should not onSubscribe after adding a new subscriber (#1190)WorkQueueProcessor.forceShutdown
should interrupt hanging threads (#1142)Flux.publish
should properly dispose its state on cancel (#1173)
Many thanks for you reports folks !!! 💃
@Vulcannis @rwinch @elrodro83 @stavalfi
Special thanks to @OlegDokuka for his continuous support on our Gitter channel 🥇
v3.1.6.RELEASE
This is the 7th release of Reactor 3.1, part of BISMUTH-SR8
Release Train.
This maintenance update is mainly backporting QoL enhancements and fixes from the ongoing 3.2.0 development effort.
⚠️ Update considerations and deprecations
Operators.onErrorDropped
still bubbles the exception up, but it also logs the error (#1118, 97d110f)- see the associated
Mono.fromFuture
change below
- see the associated
- Most operators that go back to the blocking paradigm now throw an exception when used from
parallel()
andsingle()
Schedulers
(#1102 , 5291239)Mono#block
,Flux#blockFirst
,Flux#blockLast
,toIterator
,toStream
✨ New features and improvements
StepVerifier.withVirtualTime
is now mutually exclusive to better protect from its side effects onSchedulers
when running multiple tests in parallel (#648, 65e7d62)
🪲 Bug fixes
Mono.fromFuture
would sometimes swallow errors.- Although fatal errors like
StackOverflowError
are bubbled up and are not expected to be part of the sequence anymore, here such error would totally disappear. NowMonoCompletionStage
drops such errors, which results in the SOE being logged thanks to the associated change toOperators.onErrorDropped
(97d110f, #1118)
- Although fatal errors like
- Avoid interrupting
WorkerTask
Future
in case of cancel race (#1107, e8f7867)
v3.1.5.RELEASE
This is the 5th release of Reactor 3.1, part of BISMUTH-SR7
Release Train.
This is a recommended update for all Reactor 3 users. Note that all fixes in this release
are backports of fixes in the upcoming 3.2.0.RELEASE.
✨ New features and improvements
create
usesonOperatorError
hook instead ofonErrorDropped
, avoiding thrown exceptions (#1078)
🪲 Bug fixes
RejectedExecutionException
now only terminate theExecutorScheduler
if the underlyingExecutor
is shut down (#1080)- Fixed
DisconnectException
on cancellation race inParallelFlux#refCount
(#1088)
📖 Documentation, Tests and Build
- Warn on
doOnSubscribe
javadoc: not for acting on theSubscription
(#1090) - Fix return clause of
blockLast
javadoc mentioning "first" element instead of "last" (#1095) - Small internal cleanup of
groupBy
code (#1094)
👍 Thanks to the following contributors that also participated to this release
v3.1.4.RELEASE
This is the 4th release of Reactor 3.1, part of BISMUTH-SR6
Release Train.
This is a recommended update for all Reactor 3 users.
⚠️ Update considerations and deprecations
- The MPSC
Queue
implementation from3.1.3.RELEASE
shouldn't have been public (#1010, #1035)- it is now exposed as a plain
Queue
throughQueues.unboundedMultiproducer()
- it is now exposed as a plain
- 3 operator implementations have mistakenly been released as public classes (#1036)
- These classes shouldn't have normally been noticed by users. However they have now been made private.
FluxDelaySequence
,FluxIndex
andFluxIndexFuseable
- Emitting a
Context
as part ofFlux.repeatWhen
andFlux.retryWhen
companion flux triggers a specific behavior (#1048)- The emitted
Context
, which acts as a trigger for resubscription to the source, replaces the originalContext
of the
xxxWhen operator and becomes visible to the upstream from that point. - Care should be taken to craft that
Context
from the originalContext
, otherwise you risk blindly deleting keys from the original that 3rd party libraries rely on. (this is described in the javadoc)
- The emitted
- Like
Flux.zip
,Mono.zip
short-circuits on the first source that terminates empty, cancelling other pending sources (#1071)- this means that the Mono will complete as soon as any
Mono<Void>
source or any emptyMono<T>
completes. this could lead to earlier than expected completions. - note this changes nothing for sources that are all valued
- You should look for
Mono.zip(...).then()
pattern in your code and replace that withMono.when(...)
instead, aswhen
does wait for all completions and results in aMono<Void>
. - If you want to keep the behavior of letting all valid sources run to completion, use
Mono.zipDelayError
, which
won't cancel other sources (aggregating to a compositeonError
in case of 1+ errors, or an empty mono in case
of 0 error and 1+ empty sources)
- this means that the Mono will complete as soon as any
✨ New features and improvements
log
now has a variant that directly takes aLogger
instance, which can improve performance if the bottleneck
is the resolution of Loggers (#956)- a new variant of merge, the
mergeOrdered
, has been added toFlux
andParallelFlux
(#963) Flux.concatWithValues(T...)
andMono.thenReturn(T)
have been added to conveniently concat/continue with
scalar values (#1029)- Operators that used to synchronize around a queue now use the new MPSC queue implementation instead (#914)
distinct
now allows for arbitrary backing store, not necessarily aCollection
, if you also provide a
"distinct check"BiPredicate
(#1054)- In Kotlin extensions, nullable types are mapped to non-nullable Monos (#1062)
- Emitting a
Context
as part ofFlux.repeatWhen
andFlux.retryWhen
companion flux triggers a specific behavior (see update considerations above, #1048) - Core implementations of
Scheduler
andWorker
are nowScannable
(#1050)- The interfaces themselves are not, so you'll need to attempt scanning by first calling
Scannable.from(schedulerInstance)
ExecutorService
-backed schedulers can offer a degree of insight into their executor if it is aThreadPoolExecutor
, via
scanning ofCAPACITY
andBUFFERED
- Most core executors that used to be backed by a
Executors.newSingleThreadExecutor
(which isn't introspectable by the above
method) are now backed by aThreadPoolExecutor
with acorePoolSize
==maxPoolSize
of1
.
- The interfaces themselves are not, so you'll need to attempt scanning by first calling
- Most operators that take a
Scheduler
as parameter can return thatScheduler
or theWorker
they use via ascan()
of the newAttr.RUN_ON
attribute. AScannable.UNAVAILABLE_SCAN
is returned if that information is not available (dcc36e5)
🪲 Bug fixes
doOnEach
could be ignored in case of aFuseable
source, due to a mistake in the way it would call its
downstreamonSubscribe
method with its source rather than itself (#1056, #1067)- The
elastic
Scheduler
would retain a reference to all its expired workers, which has now been fixed (#1070) - The
TopicProcessor
andWorkQueueProcessor
forceShutdown()
method would fail to shut down the "request task"
backingExecutorService
(#1074) - Like
Flux.zip
,Mono.zip
short-circuits on the first source that terminates empty, cancelling other pending sources
(see update considerations above, #1071)
📖 Documentation, Tests and Build
- Documentation improvements and typo corrections
- Various test improvements making some tests less brittle on our CI
japicmp
now has the previous 3.1.3.RELEASE as baseline (1c0fa6d)- Some tests were missing a final
verify()
call, and as such not testing anything (#1046)
👍 Thanks to the following contributors that also participated to this release
v3.1.3.RELEASE
This is the 3rd release of Reactor 3.1, part of BISMUTH-SR5
Release Train.
This is a recommended update for all Reactor 3 users.
⚠️ Update considerations and deprecations
- The implementations of
bufferWhen
andwindowWhen
(which are also backing their timeout based variants) have changed, fixing leaks in the process. distinct()
/distinctUntilChanged()
now use the full object (with aHashSet
) instead of just the extractedhashcode()
for their distinct criteria (#1025)EventLoopProcessor#shutdownAndAwait(long, TimeUnit)
has been deprecated (#986)- MpscLinkedQueue, FluxDelaySequence, FluxIndex, FluxIndexFuseable have been scoped public API and
should NOT be used.
A patch release will fix their scope back to package scope.
✨ New features and improvements
- If Level is FINE/FINEST,
log()
now logs errors usingdebug()
/trace()
(#967) - ParallelFlux#composeGroup maintains
parallelism()
(#968) EventLoop
basedProcessors
now have aDuration
basedshutdownAndAwait
(#986)- Test features:
- Add
delaySequence
operator to Flux, that just shifts the sequence forward in time (#989) - Prevent handle sink usage after error/complete (#965)
- Make
Context
accessible throughSignal
frommaterialize
anddoOnEach
(#947, #1004) - Avoid using only hashcode as default
distinct()
/distinctUntilChanged()
criteria (#1025)
🪲 Bug fixes
- Detect same-thread request in Mono subscribeOn (#943, #949)
- Execute
doFinally
even ifsubscribe()
throws (#951) - Don't retain reference to UnicastProcessor subscriber on cancel (#980)
- Prevent NPE when debug mode is activated via command line (#985)
- Fix eventual premature termination issue with WorkQueueProcessor (4b2fd19)
- [test] VirtualTimeScheduler: Use single worker, wait for expectations before advancing time (#1001, #992, #959)
windowWhile
now replenishes on premature cancel (#1017)- Fixed leak: retaining of windows in
windowWhen
(#975) - Fixed leak: buffers being retained until completion of a
bufferWhen
Flux (#969, 170f39b) - Notify lack of request on bufferTimeout (#994)
- Process fatal exceptions in Schedulers.handleError, don't throw / silently fail (#916)
📖 Documentation, Tests and Build
- Improve documentation of Flux.merge, advanced features reference guide, various typos (#1020, #970)
- Bump Kotlin, AssertJ and ReactiveStreams versions (#915, 69fbde6, 6c0bde7)
- Improve CI testing, avoid longer tests on Travis only, decrease verbosity of some tests (14d607b, #325, #1007, )
👍 Thanks to the following contributors that also participated to this release
v3.2.0.M1
3.2.0 MILESTONE 1
This version of 3.2.0 is an advance MILESTONE (despite the fact that development continues in parallel on 3.1.3.RELEASE). Its main goal is to make the "error mode" feature accessible for testing (see #629 and
ce62135).
Note that all latest developments on the master branch for 3.1.x versions are not necessarily present in this milestone, as it was branched from master on Jan. 10 2018 (commit 5a4d38f "Notify lack of request on bufferTimeout" in the history)
v3.1.2.RELEASE
This is the 3rd release of Reactor 3.1, part of BISMUTH-SR4
Release Train.
This is a recommended update for all Reactor 3 users. It notably contains a new Flux
operator called index
to index as a Tuple<Long, T>
or any arbitrary container each element from a sequence.
✨ New features and improvements
- Add
Flux#index
operator (#934) - Add
Mono#single
to enforce the presence of an element in aMono<T>
(#940) - Add
Mono#blockOptional
to block and return anOptional
(#918) - Add
Flux#fromStream(Supplier<Stream>)
(#922) - Use an explicit timeout message for
timeout
operator (#925) - Add a Kotlin extension to create a
Mono
from aSupplier
(#929)
🪲 Bug fixes
- Fix
concatDelayError
andconcatMapDelayError
withMono.error
(#936)
📖 Documentation, Tests and Build
- Add
Context
simple example in reference guide (#921) - Fix javadoc marble for
Mono.repeatWhenEmpty
(#919) - Fix CLA in Contributing.md (#98b32f5)
- Fix links to JDK Reference (#a0d8126)
- Add
cache(Duration)
javadoc (#930) - Fix
Context
content in test (#950) - Improvve
Scheduler
javadoc (#935)