Skip to content

Releases: reactor/reactor-core

v3.2.0.M3

26 Jul 15:44
Compare
Choose a tag to compare
v3.2.0.M3 Pre-release
Pre-release

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 by Schedulers.[new]parallel()), but unlike before it doesn't enforce a minimum of 4 anymore. It can be tuned via system property reactor.schedulers.defaultPoolSize now though (#1243, #1246)
  • repeat(N) is now aligned with retry(N), as well as repeat(N, Predicate)/retry(N, Predicate): the number indicates the amount of repetitions of the original sequence, ie 0 mirrors the original sequence while 1 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 with Flux/Mono.empty()
  • errorStrategyContinue() methods from M1 have been renamed to onErrorContinue 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 via log() during an onNext, its toString method is explicitly called (#1270)
    • typically this would happen when using window() immediately followed by log(), which is not really useful but was even less useful since it would trigger an exception
  • Tuple2..Tuple8 now have mapT1..mapT8 (as relevant) methods that allow to change a single part of the Tuple (e4a9aee, discussed in #1058)
  • usingWhen from M2 can now be cancelled early before the resource Publisher emitted, which cancels said Publisher. 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 and bufferWhen issues have been corrected around cancellation and drain race conditions (#1247)
  • The usingWhen operator from M2 wouldn't propagate the main sequence's Context to commit/rollback Publishers (#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

@madgnome, @MarkusJais, @smiklos

v3.2.0.M2

13 Jun 12:10
Compare
Choose a tag to compare
v3.2.0.M2 Pre-release
Pre-release

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() to Flux (#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
  • 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 complex retryWhen(Function) and the more configurable RetryFunction from reactor-addons
  • New operators for transactional reactive use cases: usingWhen (#1220, b87ea6d)
    • Like using, but the resource is provided asynchronously through a Publisher
    • 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 the onNext signals.

⚠️ Update considerations and deprecations

  • windowUntil and windowWhile 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 error
    • Mono.fromCompletionStage now drops fatal exceptions rather than hanging (#1118)
  • Blocking APIs (like blockLast(), block(), iterator()) called inside a parallel or single Scheduler 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 the END (#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 uses Operators.onOperatorError hook instead of onErrorDropped (#1078)
  • (deprecation) Scannable#operatorName() is deprecated in favor of stepName() (#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 a Scheduler, added Mono.cache TTL-generator variant (#1189, #1125)
  • Operators.lift now has an alternative that exposes the raw Publisher: liftPublisher (#1205)
  • Operators.lift now supports Fuseable (#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 support Fuseable and ConditionalSubscriber (#1003)
  • Flux.take(0) now eagerly cancels on subscription (#1158)
  • Lazy Mono#fromFuture and Mono#fromCompletionStage added, with Supplier param (#1131)
  • Add an `error(Supplier)`` variant to Flux and Mono (#1100)
  • Add Scannable#steps(), which produces a Stream<String> of all the stepNames both upstream and downstream (including the current Scannable) (#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 convert Flux<List<T>> to Flux<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 a TestLogger 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 a StepVerifier (#1236)

🪲 Bug fixes

  • Flux.last() now correctly throws a NoSuchElementException on empty source even when said source is a Callable Mono(#1226)
  • delayUntil correctly request Long.MAX_VALUE and not Integer.MAX_VALUE on subscribe (#1214)
  • Operators.lift() properly maintain GroupedFlux/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 defer advanceTime 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 by thenAwait, hanging the test.
  • 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

👍 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

11 Jun 05:38
Compare
Choose a tag to compare

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 a NoSuchElementException on some category of empty sources (Flux or Mono that are Callable). This is a bug and it correctly does throw now. (#1226)

✨ New features and improvements

  • All operators implement Scannable (#1136)
  • Operators.lift function now supports Fuseable (#1206)

🪲 Bug fixes

  • Flux.last() throws NoSuchElementException (see update considerations section, #1226)
  • Operators.lift properly maintain GroupedFlux/ConnectableFlux interface (#1204)
  • Request is not tracked in FluxOnBackpressureBufferTimeout (#1194)
  • Let Flux.interval support 0 delay/period (#1178)
  • delayUntil now requests Long.MAX_VALUE instead of Integer.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

@madgnome, @OlegDokuka

v3.1.7.RELEASE

04 May 20:48
Compare
Choose a tag to compare

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

03 Apr 04:37
Compare
Choose a tag to compare

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
  • Most operators that go back to the blocking paradigm now throw an exception when used from parallel() and single() 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 on Schedulers 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. Now MonoCompletionStage drops such errors, which results in the SOE being logged thanks to the associated change to Operators.onErrorDropped (97d110f, #1118)
  • Avoid interrupting WorkerTask Future in case of cancel race (#1107, e8f7867)

v3.1.5.RELEASE

27 Feb 15:42
Compare
Choose a tag to compare

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 uses onOperatorError hook instead of onErrorDropped, avoiding thrown exceptions (#1078)

🪲 Bug fixes

  • RejectedExecutionException now only terminate the ExecutorScheduler if the underlying Executor is shut down (#1080)
  • Fixed DisconnectException on cancellation race in ParallelFlux#refCount (#1088)

📖 Documentation, Tests and Build

  • Warn on doOnSubscribe javadoc: not for acting on the Subscription (#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

@baptistemesta, @smiklos

v3.1.4.RELEASE

15 Feb 14:33
Compare
Choose a tag to compare

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 from 3.1.3.RELEASE shouldn't have been public (#1010, #1035)
    • it is now exposed as a plain Queue through Queues.unboundedMultiproducer()
  • 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 and FluxIndexFuseable
  • Emitting a Context as part of Flux.repeatWhen and Flux.retryWhen companion flux triggers a specific behavior (#1048)
    • The emitted Context, which acts as a trigger for resubscription to the source, replaces the original Context of the
      xxxWhen operator and becomes visible to the upstream from that point.
    • Care should be taken to craft that Context from the original Context, otherwise you risk blindly deleting keys from the original that 3rd party libraries rely on. (this is described in the javadoc)
  • 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 empty Mono<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 with Mono.when(...) instead, as when does wait for all completions and results in a Mono<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 composite onError in case of 1+ errors, or an empty mono in case
      of 0 error and 1+ empty sources)

✨ New features and improvements

  • log now has a variant that directly takes a Logger instance, which can improve performance if the bottleneck
    is the resolution of Loggers (#956)
  • a new variant of merge, the mergeOrdered, has been added to Flux and ParallelFlux (#963)
  • Flux.concatWithValues(T...) and Mono.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 a Collection, 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 of Flux.repeatWhen and Flux.retryWhen companion flux triggers a specific behavior (see update considerations above, #1048)
  • Core implementations of Scheduler and Worker are now Scannable (#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 a ThreadPoolExecutor, via
      scanning of CAPACITY and BUFFERED
    • Most core executors that used to be backed by a Executors.newSingleThreadExecutor (which isn't introspectable by the above
      method) are now backed by a ThreadPoolExecutor with a corePoolSize == maxPoolSize of 1.
  • Most operators that take a Scheduler as parameter can return that Scheduler or the Worker they use via a scan()
    of the new Attr.RUN_ON attribute. A Scannable.UNAVAILABLE_SCAN is returned if that information is not available (dcc36e5)

🪲 Bug fixes

  • doOnEach could be ignored in case of a Fuseable source, due to a mistake in the way it would call its
    downstream onSubscribe 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 and WorkQueueProcessor forceShutdown() method would fail to shut down the "request task"
    backing ExecutorService (#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

@anonymousXrandom, @KPull, @pcroc, @sbuettner, @yilinwei

v3.1.3.RELEASE

18 Jan 02:23
Compare
Choose a tag to compare

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 and windowWhen (which are also backing their timeout based variants) have changed, fixing leaks in the process.
  • distinct()/distinctUntilChanged() now use the full object (with a HashSet) instead of just the extracted hashcode() 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 using debug()/trace() (#967)
  • ParallelFlux#composeGroup maintains parallelism() (#968)
  • EventLoop based Processors now have a Duration based shutdownAndAwait (#986)
  • Test features:
    • Added meaningful toString to StepVerifier steps (d3e6c4b)
    • Added Context testing features (#901, #898)
  • 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 through Signal from materialize and doOnEach (#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 if subscribe() 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

@glyn, @OlegDokuka, @onionf91, @stamhankar999

v3.2.0.M1

12 Jan 17:50
Compare
Choose a tag to compare
v3.2.0.M1 Pre-release
Pre-release

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

17 Nov 03:38
Compare
Choose a tag to compare

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 a Mono<T> (#940)
  • Add Mono#blockOptional to block and return an Optional (#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 a Supplier (#929)

🪲 Bug fixes

  • Fix concatDelayError and concatMapDelayError with Mono.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)

👍 Thanks to the following contributors that also participated to this release

@baptistemesta, @naxhh