Releases: typelevel/cats-effect
v3.7.0-RC1
This is the fifty-ninth release in the Cats Effect 3.x lineage. It is fully binary compatible with every 3.x release and intended to be fully source-compatible with the 3.7.x lineage. While we always strive to avoid making breaking changes between release candidate and final versions, in some cases it cannot be avoided and no strong guarantees are provided.
What's Changed
This is a relatively smaller minor release jump relative to 3.6.x since it contains a major and long-anticipated enhancement: support for Scala Native 0.5, including full multithreading on LLVM! This has been a very long time coming, and we've been planning how to provide this support and planting the seeds for several years now. As noted in previous release notes, the integrated runtime released in 3.6.0 provides the basic building blocks for true, practically usable multithreaded asynchronous I/O on LLVM, and this release finally brings all of those pieces to fruition.
Full support has been implemented for epoll and kqueue, and we intend to extend this support to io_uring in the future. These polling systems have been significantly upgraded and enhanced since 3.6.x in order to support the same sort of thread coordination that has been present on the JVM from the beginning.
Of course, the largest piece of this is the WorkStealingThreadPool itself. This was ported from JVM-only to cross-build entirely on both JVM and LLVM targets. Surprisingly, almost no changes were required to make this possible! It is a testament to the thought and effort which went into Scala Native 0.5 that this port was dramatically smoother and less complex than anyone could have reasonably predicted. While we did run into a few minor issues with Scala Native, only one major problem with its multithreading support was encountered, and it only applies in a very niche scenario which was easily worked around.
We really cannot stress enough how impressed we are with Scala Center and Virtus' work on this front. Scala Native 0.5 is quite the triumph, and Cats Effect 3.7 is the proof. Going forward, you should essentially expect rough parity between scheduling functionality on JVM and LLVM, with JavaScript now being the unusual one (due to its single-threaded nature).
As an aside, it's worth noting that this parity holds despite the fact that Scala Native actually implements subtly different memory publication semantics than the JVM in some very specific circumstances. The Cats Effect concurrency state model (i.e. Ref/Deferred) is such that these semantic differences are entirely invisible in userspace, while the performance benefits are present regardless. This is one example of the careful planning and coordination which went into this release spanning across many people and multiple projects.
The one area in which Cats Effect on Scala Native meaningfully lags behind the JVM is fiber tracing. This functionality should exist on LLVM, but it appears that the APIs do not work correctly at runtime. It is expected that these bugs will be resolved in a future Scala Native release, at which point we'll be able to enable the functionality in Cats Effect.
Enhancements
- Add
SecureRandominstance toSyncIOcompanion by @qxrein in #4324 - Add
realTimeZonedDateTimetoClockJVM extensions by @mmienko in #4316 - Add support for Native multithreaded execution by @durban in #4201
blockingandinterruptibleon Scala Native by @djspiewak in #4378- Add
awaitEventto expose the full featureset of kqueue by @rahulrangers in #4423 - Add IORuntime#liveFiberSnapshot by @iRevive in #4444
- Add a TestConsole by @morgen-peschke in #4394
- Add NonEmptyHotswap by @morgen-peschke in #4267
- Add
KeyedMutexby @BalmungSan in #4065 - Add
IOLocal#asLocal[F[_]]:Local[F,A]by @NthPortal in #4438
Bug Fixes
- Don't expose private WSTP type in method signature by @armanbilge in #4290
- Make
IOFiber#{_join,_cancel}volatile on Native by @durban in #4400 - Removed
IORuntimeBuilder#addPolleron Scala.js by @djspiewak in #4419- As a brief callout, this change actually represents a binary-breaking change relative to Cats Effect 3.6.x on Scala.js! We almost universally avoid doing this, but in this case the type signature exposure was entirely accidental and the method never worked, so anyone who wrote code which called that method on Scala.js would have simply had broken code. For this reason, we felt justified in the binary break.
- Make the heap in
TimerHeapvolatile on native by @armanbilge in #4443 - Fix wstp shutdown interrupt (3.x edition) by @djspiewak in #4344
- Use
_exitinstead of System.exit in fatal cases by @djspiewak in #4428 - Fix source compatibility with Scala 3.6 by @mbovel in #4381
Documentation
- docs: provide an example on how to collect fiber dump programmatically by @iRevive in #4399
- code snippet typo in faq.md by @combinatorist in #4395
- Fix typo in documentation of function tryOfferN of QueueSink and PQueueSink. by @nmichael44 in #4384
- Change tutorial CopyFile object name by @davidsalter in #4458
Behind the Scenes
- Update scala-library to 2.13.16 in series/3.x by @typelevel-steward[bot] in #4239
- Update sbt-scalajs, scalajs-compiler, ... to 1.18.2 in series/3.x by @typelevel-steward[bot] in #4249
- Revert documentation format changes by @mzuehlke in #4246
- Update scala3-library, ... to 3.3.5 in series/3.x by @typelevel-steward[bot] in #4261
- Replace specs2 with munit by @iRevive in #4216
- Update scalafmt-core to 3.9.4 in series/3.x by @typelevel-steward[bot] in #4297
- Replace deprecated commands in build.sbt by @iRevive in #4339
- Update cats-core, cats-free, ... to 2.13.0 in series/3.x by @typelevel-steward[bot] in #4356
- Update sbt-scalafix to 0.14.3 in series/3.x by @typelevel-steward[bot] in #4403
- Update sbt-typelevel to 0.8.0 in series/3.x by @typelevel-steward[bot] in #4417
- Update sbt, scripted-plugin to 1.11.3 in series/3.x by @typelevel-steward[bot] in #4427
- flake.lock: Update by @typelevel-steward[bot] in #4414
- Update sbt-mdoc to 2.7.2 in series/3.x by @typelevel-steward[bot] in #4441
- SN 0.5.6 -> 0.5.7 -> 0.5.8 by @durban in #4362
New Contributors
- @mmienko made their first contribution in #4316
- @mbovel made their first contribution in #4381
- @combinatorist made their first contribution in #4395
- @nmichael44 made their first contribution in #4384
- @NthPortal made their first contribution in #4438
- @morgen-peschke made their first contribution in #4394
- @davidsalter made their first contribution in #4458
Full Changelog: v3.6.3...v3.7.0-RC1
v3.6.3
This is the fifty-eighth release in the Cats Effect 3.x lineage. It is fully binary compatible with every 3.x release and fully source-compatible with the 3.6.x lineage.
Warning
Please note that Cats Effect 3.6.x is targeting Scala Native 0.4.x, which means it does not at present support native multithreading. This was a very intentional choice meant to give us an opportunity to break binary compatibility only on Scala Native if necessary when upgrading to Scala Native 0.5 and as we discover the impacts of the integrated runtime on the downstream ecosystem. It also reduces risk since Native multithreading in the runtime is a significant lift and we want to make sure we isolate that change from the already significant changes in 3.6.0. This functionality has already merged into the development branch and we plan to release it in 3.7.0 as soon as possible.
What's Changed
This release fixes a pretty nasty bug introduced in 3.6.2 which frequently results in the thread pool being entirely poisoned, producing severe performance degradation that could only be resolved by restarting the process. It is highly recommended that all users on 3.6.2 upgrade to 3.6.3 as soon as possible.
Bug Fixes
Full Changelog: v3.6.2...v3.6.3
v3.6.2
This is the fifty-seventh release in the Cats Effect 3.x lineage. It is fully binary compatible with every 3.x release and fully source-compatible with the 3.6.x lineage.
Warning
Please note that Cats Effect 3.6.x is targeting Scala Native 0.4.x, which means it does not at present support native multithreading. This was a very intentional choice meant to give us an opportunity to break binary compatibility only on Scala Native if necessary when upgrading to Scala Native 0.5 and as we discover the impacts of the integrated runtime on the downstream ecosystem. It also reduces risk since Native multithreading in the runtime is a significant lift and we want to make sure we isolate that change from the already significant changes in 3.6.0. This functionality has already merged into the development branch and we plan to release it in 3.7.0 as soon as possible.
What's Changed
This release addresses a performance issue since 3.6.0 that was reported to be somewhat severe in applications which leverage asynchronous I/O without using the new polling system. Extensive discussion of this issue can be found in #4328. While a workaround was possible, the regression was certainly undesirable. We've changed the polling logic to be considerably less aggressive. In particular, threads will only poll if the polling system has outstanding events which require polling. This means that any applications which make no use of the polling system should see marginal (if any) overhead relative to pre-3.6 versions of Cats Effect, while applications which lean heavily on the new integrated runtime will still see the full benefits thereof.
Note that there is a somewhat pathological case here where an application makes use of the polling system (usually via some dependency, like Skunk or Ember), but does not make heavy use of that code path while simultaneously making very heavy use of other asynchronous I/O mechanisms (such as Netty or Blaze, often indirectly via other dependencies). In this scenario, the worker threads will be forced to make the more expensive polling syscalls, but those calls will often yield very small or empty batches while the majority of the work is enqueued externally (via other async I/O mechanisms). This will result in meaningful overhead relative to the theoretical optimal behavior.
We made the conscious decision in 3.6.0 to prioritize the performance of the integrated runtime, and while we certainly still want all use cases to behave as optimally as possible, this does mean that we occasionally needed to make some tradeoffs in order to achieve the performance goals we had in mind. Our hope is that as the ecosystem continues to adapt to the use of the integrated runtime (particularly with the rise of Scala Native 0.5, where there are essentially no other viable options), these edge cases will become quite rare.
Enhancements
Bug Fixes
- Make
IO#syncStepinterpreter stack-safe by @pantShrey in #4352 - Set
mayInterruptIfRunning = truewhen cancelingCompletableFutureby @istreeter in #4375 - Retrieve suspended fiber count directly through the WSTP by @iRevive in #4406
- Handle
EPOLLHUPinEpollSystemby @rahulrangers in #4422 - Dynamically bypass selector polling if no I/O events are present by @djspiewak in #4377
- Fix #4367: Wrap tracingEvents in Option to handle NPE by @pantShrey in #4380
- PoC for not using a CHM in #4388 by @durban in #4426
- Fix #4382: Fix thread leak in WSTP by replacing LinkedTransferQueue with SynchronousQueue and ConcurrentHashMap by @pantShrey in #4388
- Update the main thread detection logic by @iRevive in #4407
Documentation
- Update tutorial.md by @xdev-developer in #4371
- Fixed the sample code inconsistency in
IOLocalscaladoc by @arinal in #4391 - Add doc for
IOApp#pollingSystemby @armanbilge in #4222
Behind the Scenes
- Update versions for 3.6.1 by @armanbilge in #4363
- Fix sbt scalafmt check by @armanbilge in #4373
New Contributors
- @xdev-developer made their first contribution in #4371
- @pantShrey made their first contribution in #4352
- @istreeter made their first contribution in #4375
- @arinal made their first contribution in #4391
- @rahulrangers made their first contribution in #4422
Full Changelog: v3.6.1...v3.6.2
v3.6.1
This is the fifty-sixth release in the Cats Effect 3.x lineage. It is fully binary compatible with every 3.x release and fully source-compatible with the 3.6.x lineage. Please note that we did break binary compatibility with 3.6.0 RC1 (not with 3.5.x) in order to fix some things, so if you published anything against that release you will need to reconsider your life choices.
Warning
Please note that Cats Effect 3.6.x is targeting Scala Native 0.4.x, which means it does not at present support native multithreading. This was a very intentional choice meant to give us an opportunity to break binary compatibility only on Scala Native if necessary when upgrading to Scala Native 0.5 and as we discover the impacts of the integrated runtime on the downstream ecosystem. It also reduces risk since Native multithreading in the runtime is a significant lift and we want to make sure we isolate that change from the already significant changes in 3.6.0. This functionality has already merged into the development branch and we plan to release it in 3.7.0 as soon as possible.
What's Changed
Bug Fixes
- Also interrupt pollers when shutting down the WSTP by @durban in #4340
- Make deprecated
IO.onErrorpackage private by @CJSmith-0141 in #4343
Documentation
- Document
PollingSystem#metricsby @antoniojimeneznieto in #4334
Behind the Scenes
- Update versions for 3.6.0 by @djspiewak in #4311
- Restore GraalVM Native Image test in CI by @armanbilge in #4315
New Contributors
- @CJSmith-0141 made their first contribution in #4343
Full Changelog: v3.6.0...v3.6.1
v3.6.0
This is the fifty-fifth release in the Cats Effect 3.x lineage. It is fully binary compatible with every 3.x release and fully source-compatible with the 3.6.x lineage. Please note that we did break binary compatibility with 3.6.0 RC1 (not with 3.5.x) in order to fix some things, so if you published anything against that release you will need to reconsider your life choices.
Warning
Please note that Cats Effect 3.6.x is targeting Scala Native 0.4.x, which means it does not at present support native multithreading. This was a very intentional choice meant to give us an opportunity to break binary compatibility only on Scala Native if necessary when upgrading to Scala Native 0.5 and as we discover the impacts of the integrated runtime on the downstream ecosystem. It also reduces risk since Native multithreading in the runtime is a significant lift and we want to make sure we isolate that change from the already significant changes in 3.6.0. This functionality is already under development and we plan to release it in 3.7.0 as soon as possible.
What's Changed
This release contains the largest change to the Cats Effect internal work scheduler since the introduction of work stealing back in the run up to 3.0.0. In particular, we have finally completed implementation of the integrated runtime we first conceived of back in early 2022. Well, I say "we", but really @armanbilge deserves the absolute lion's share of the credit here. He did almost all of the work not only on the direct implementation in Cats Effect, but also the downstream functionality built on top of it in Fs2 and in Http4s… not only on the JVM but also in Scala Native and across multiple operating systems! It is hard to overstate how gargantuan of an effort this was, both in design and implementation.
As immense as the effort has been, the impact is even more dramatic. We've already observed scenarios in which the performance of microservices implemented on top of Http4s Ember on the JVM leveraging io_uring is improved by over 3.5x! That is to say, the performance is 3.5x higher than baseline using classical NIO2! (as measured by TechEmpower, suggesting performance more than 2x higher than pekko-http) Now, TechEmpower does have its limitations as a framework, but it does represent a useful standard candle for certain access patterns, and improving an already very fast trio of frameworks by this magnitude is not something that happens every day. Even more excitingly, this is just the tip of the iceberg! We ran these tests with very early, almost PoC code with a lot of performance-impacting caveats. The best is yet to come.
And if that wasn't enough, the biggest impacts are not on the JVM but actually on Scala Native. Without diving too far into the details, this type of syscall scheduling mechanism is exactly what is necessary on Scala Native to achieve any measure of performance from downstream services. It is actually remarkably similar to what the Go runtime does, though implemented in a more extensible way (e.g. Go does not, at present, have native support for io_uring, whereas Cats Effect can and has implemented this via a third-party library).
Going forward, Cats Effect will be maintaining support for the following polling systems:
- JVM
Selector
- Native
- kqueue
- epoll
Support for io_uring is already under heavy development, and we expect to incorporate this into Cats Effect at some future date, supporting both Native and JVM. The integrated runtime was specifically designed with io_uring's unique data patterns in mind and we have already been able to demonstrate that downstream layers of the ecosystem will be able to fully leverage its benefits. Additionally, we believe we can meaningfully improve JVM performance by implementing epoll and kqueue support for the JVM (and not just Native), the former for situations where io_uring is unavailable. This is mostly because Selector is actually very very slow, and while the performance of the Selector-based runtime is roughly on par with what we've been able to achieve on top of NIO2 (which has its own syscall management and is incompatible with the integrated runtime), we know we can do quite a bit better.
On top of the above, this release contains a large number of other enhancements covering a number of major scenarios. Most noticeably, thanks to @kamilkloch, explicitly importing cats.syntax.all._ is no longer required for most usage involving explicit IO! You will still need the syntax import for any use of parametric effects (commonly referred to as "tagless final" or F[_]), and unfortunately due to the way Scala's type inference works, it is also required for the very common traverse function, but nearly any and all other cases have had their implicit search tweaked to avoid this inconvenience. This in turn means that . completion now mostly Just Works™ when using IO (and when it doesn't, hunting for methods on the IO companion object definitely works).
An additional class of work went into substantially improving the internal instrumentation and metrics associated with the runtime. As previously, these are all exposed as JMX MBeans on the JVM, but we have additionally added public APIs which allow applications to self-instrument (rather than forcing external untyped instrumentation via JMX). These metrics have been organized to mirror the structure of the runtime itself and can all be found within the cats.effect.unsafe.metrics package.
If you're an end-user of Cats Effect (in other words, you run applications built on Cats Effect, rather than building libraries or frameworks), one way you can very much aid the future development of the library is to incorporate these metrics (likely via JMX) into your application observability and key metrics. This should allow you to start to build up an intuition for what metrics are significant indicators of good or bad or just plain normal behavior. This is exactly the type of information that is difficult for library authors to realistically determine, but if end-users learn this on our behalf, you can help educate us on the precise details of how the runtime behaves for your application in your production context, shaping the future optimization and tuning of the framework! (note: Cats Effect does not proactively send metrics anywhere from your application, it merely exposes them to your own monitoring infrastructure)
Enhancements
- Polling system by @armanbilge in #3332
evalOnExecutorby @homycdev in #3691- Native signal handling and safe
IOAppcancelation by @armanbilge in #3695 - Add
warnOnNonMainThreadDetectedconfiguration toIOAppby @diogocanut in #3815 - Block in-place if running on a virtual thread by @armanbilge in #3870
- Add
GenConcurrent#parSequenceN_andGenConcurrent#parTraverseN_. by @kamilkloch in #3916 - Apply
@staticannotation internally by @armanbilge in #3934 - Added
PriorityQueue{Sink,Source}extendingQueue{Sink,Source}by @neomaclin in #3930 - Timer stealing without a concurrent data structure by @armanbilge in #3781
- Embed
cats.syntax.all._intoIO. by @kamilkloch in #3532 - Quick and dirty unsafe queue API by @djspiewak in #3975
- Implement async dropping queue by @iRevive in #4143
- Refactor
Ref#mapKto takeFunctor[G]constraint instead ofFunctor[F]by @armanbilge in #4115 - Add
ownPollerby @armanbilge in #4133 - Use
IO.unitinAsync[IO].unitby @iRevive in #4162 - Add default constructor for
MapRefby @yisraelU in #4139 - Add
SystemPropertiesby @massimosiani in #3924 - Make
timeout/timeoutToalways return the outcome of the effect by @biochimia in #4059 IOLocalpropagation for unsafe access by @armanbilge in #3636- Make
UUIDGenmore performant by @diogocanut in #3647 cats.mtl.Local[IO, E]fromIOLocal[E]by @rossabaker in #3429- Implement
IORuntimeMetricsby @iRevive in #3317 - Use global counter as an MBean ID for WSTP by @iRevive in #4186
- Add a
memoizedAcquiremethod toResourceby @satabin in #4105 - Add
TimerHeapMetricsby @iRevive in #4187 - Add pack count metric for
TimerHeapby @armanbilge in #4207 - Add
WorkerThread-specific metrics by @armanbilge in #4206 - Introduce
PollerMetricsby @armanbilge in #4209 - Add
UUIDGeninductive materializers for monad transformers by @bio-aeon in http...
v3.6.0-RC2
This is the fifty-fourth release in the Cats Effect 3.x lineage. It is fully binary compatible with every 3.x release and expected to be fully source-compatible with the eventual 3.6.x lineage. However, we did break binary-compatibility with the previous candidate v3.6.0-RC1.
This release candidate is expected to be very stable, and our main rationale for releasing it as such rather than as a full 3.6.0 is to allow the ecosystem (and adventurous end users!) to try it out and find unforeseen problems prior to full release. If fixing those problems require breaking compatibility prior to 3.6.0 (while maintaining bincompat with 3.x) we will do so, but otherwise you should expect this release to roughly represent the exact API surface area we will ultimately release.
Warning
Please note that Cats Effect 3.6.x is targeting Scala Native 0.4.x, which means it does not at present support native multithreading. This was a very intentional choice meant to give us an opportunity to break binary compatibility only on Scala Native if necessary when upgrading to Scala Native 0.5 and as we discover the impacts of the integrated runtime on the downstream ecosystem. It also reduces risk since Native multithreading in the runtime is a significant lift and we want to make sure we isolate that change from the already significant changes in 3.6.0. This functionality is already under development and we plan to release it in 3.7.0 as soon as possible.
What's Changed
Enhancements
- Add
UUIDGeninductive materializers for monad transformers by @bio-aeon in #4220 - Add helpers to
Selectorpoller by @armanbilge in #4226 - Setup
UncaughtExceptionHandlerforWorkerThreadby @armanbilge in #4233 - Add message to requirements by @Jasper-M in #4259
- Poll on the 0th tick, check external queue on 32nd by @armanbilge in #4270
Bug Fixes
- Report non-fatal
Runnablefailures onMainThreadEC by @armanbilge in #4223 - Always report timers/events when worker unparked by @armanbilge in #4227
- Introduce
PollResult,PollingSystem#processReadyEventsby @armanbilge in #4230 - Shutdown the runtime only when unforked by @armanbilge in #4234
- Restore
ArrayBlockingQueuefor worker-to-blocking state transfer by @armanbilge in #4255 - Refactor
WorkerThreadrunloop; avoid pathological starvation of pollers by @armanbilge in #4247 - Transfer tick state when replacing a blocked thread by @armanbilge in #4264
WorkStealingPoolMetrics->WorkStealingThreadPoolMetricsby @armanbilge in #4271- Run finalizers in
IO#unsafeRunTimedby @armanbilge in #4279 - Create
UnsafeNonFatalfor use in the fiber runtime by @kapunga in #4263
Documentation
- Fix small typo in docs by @serragnoli in #4257
- Document
Pollby @arturaz in #4277
Behind the Scenes
- flake.lock: Update by @typelevel-steward in #4219
- Update sbt-typelevel to 0.7.5 in series/3.x by @typelevel-steward in #4218
- Delete .envrc by @armanbilge in #4224
- New year who dis by @djspiewak in #4231
- update
.scalafmt.conf. enforce new wildcard syntax by @xuwei-k in #4236 - Switch to GHA Linux ARM runners by @armanbilge in #4253
- fix warnings in scalafix rule by @xuwei-k in #4244
New Contributors
- @bio-aeon made their first contribution in #4220
- @serragnoli made their first contribution in #4257
Full Changelog: v3.6.0-RC1...v3.6.0-RC2
v3.6.0-RC1
This is the fifty-third release in the Cats Effect 3.x lineage. It is fully binary compatible with every 3.x release and expected to be fully source-compatible with the eventual 3.6.x lineage.
This release candidate is expected to be very stable, and our main rationale for releasing it as such rather than as a full 3.6.0 is to allow the ecosystem (and adventurous end users!) to try it out and find unforeseen problems prior to full release. If fixing those problems require breaking compatibility prior to 3.6.0 (while maintaining bincompat with 3.x) we will do so, but otherwise you should expect this release to roughly represent the exact API surface area we will ultimately release.
Warning
Please note that Cats Effect 3.6.x is targeting Scala Native 0.4.x, which means it does not at present support native multithreading. This was a very intentional choice meant to give us an opportunity to break binary compatibility only on Scala Native if necessary when upgrading to Scala Native 0.5 and as we discover the impacts of the integrated runtime on the downstream ecosystem. It also reduces risk since Native multithreading in the runtime is a significant lift and we want to make sure we isolate that change from the already significant changes in 3.6.0. This functionality is already under development and we plan to release it in 3.7.0 as soon as possible.
What's Changed
This release contains the largest change to the Cats Effect internal work scheduler since the introduction of work stealing back in the run up to 3.0.0. In particular, we have finally completed implementation of the integrated runtime we first conceived of back in early 2022. Well, I say "we", but really @armanbilge deserves the absolute lion's share of the credit here. He did almost all of the work not only on the direct implementation in Cats Effect, but also the downstream functionality built on top of it in Fs2 and in Http4s… not only on the JVM but also in Scala Native and across multiple operating systems! It is hard to overstate how gargantuan of an effort this was, both in design and implementation.
As immense as the effort has been, the impact is even more dramatic. We've already observed scenarios in which the performance of microservices implemented on top of Http4s Ember on the JVM leveraging io_uring is improved by over 3.5x! That is to say, the performance is 3.5x higher than baseline using classical NIO2! (as measured by TechEmpower, suggesting performance more than 2x higher than pekko-http) Now, TechEmpower does have its limitations as a framework, but it does represent a useful standard candle for certain access patterns, and improving an already very fast trio of frameworks by this magnitude is not something that happens every day. Even more excitingly, this is just the tip of the iceberg! We ran these tests with very early, almost PoC code with a lot of performance-impacting caveats. The best is yet to come.
And if that wasn't enough, the biggest impacts are not on the JVM but actually on Scala Native. Without diving too far into the details, this type of syscall scheduling mechanism is exactly what is necessary on Scala Native to achieve any measure of performance from downstream services. It is actually remarkably similar to what the Go runtime does, though implemented in a more extensible way (e.g. Go does not, at present, have native support for io_uring, whereas Cats Effect can and has implemented this via a third-party library).
Going forward, Cats Effect will be maintaining support for the following polling systems:
- JVM
Selector
- Native
- kqueue
- epoll
Support for io_uring is already under heavy development, and we expect to incorporate this into Cats Effect at some future date, supporting both Native and JVM. The integrated runtime was specifically designed with io_uring's unique data patterns in mind and we have already been able to demonstrate that downstream layers of the ecosystem will be able to fully leverage its benefits. Additionally, we believe we can meaningfully improve JVM performance by implementing epoll and kqueue support for the JVM (and not just Native), the former for situations where io_uring is unavailable. This is mostly because Selector is actually very very slow, and while the performance of the Selector-based runtime is roughly on par with what we've been able to achieve on top of NIO2 (which has its own syscall management and is incompatible with the integrated runtime), we know we can do quite a bit better.
On top of the above, this release contains a large number of other enhancements covering a number of major scenarios. Most noticeably, thanks to @kamilkloch, explicitly importing cats.syntax.all._ is no longer required for most usage involving explicit IO! You will still need the syntax import for any use of parametric effects (commonly referred to as "tagless final" or F[_]), and unfortunately due to the way Scala's type inference works, it is also required for the very common traverse function, but nearly any and all other cases have had their implicit search tweaked to avoid this inconvenience. This in turn means that . completion now mostly Just Works™ when using IO (and when it doesn't, hunting for methods on the IO companion object definitely works).
An additional class of work went into substantially improving the internal instrumentation and metrics associated with the runtime. As previously, these are all exposed as JMX MBeans on the JVM, but we have additionally added public APIs which allow applications to self-instrument (rather than forcing external untyped instrumentation via JMX). These metrics have been organized to mirror the structure of the runtime itself and can all be found within the cats.effect.unsafe.metrics package.
If you're an end-user of Cats Effect (in other words, you run applications built on Cats Effect, rather than building libraries or frameworks), one way you can very much aid the future development of the library is to incorporate these metrics (likely via JMX) into your application observability and key metrics. This should allow you to start to build up an intuition for what metrics are significant indicators of good or bad or just plain normal behavior. This is exactly the type of information that is difficult for library authors to realistically determine, but if end-users learn this on our behalf, you can help educate us on the precise details of how the runtime behaves for your application in your production context, shaping the future optimization and tuning of the framework! (note: Cats Effect does not proactively send metrics anywhere from your application, it merely exposes them to your own monitoring infrastructure)
Enhancements
- Polling system by @armanbilge in #3332
evalOnExecutorby @homycdev in #3691- Native signal handling and safe
IOAppcancelation by @armanbilge in #3695 - Add
warnOnNonMainThreadDetectedconfiguration toIOAppby @diogocanut in #3815 - Block in-place if running on a virtual thread by @armanbilge in #3870
- Add
GenConcurrent#parSequenceN_andGenConcurrent#parTraverseN_. by @kamilkloch in #3916 - Apply
@staticannotation internally by @armanbilge in #3934 - Added
PriorityQueue{Sink,Source}extendingQueue{Sink,Source}by @neomaclin in #3930 - Timer stealing without a concurrent data structure by @armanbilge in #3781
- Embed
cats.syntax.all._intoIO. by @kamilkloch in #3532 - Quick and dirty unsafe queue API by @djspiewak in #3975
- Implement async dropping queue by @iRevive in #4143
- Refactor
Ref#mapKto takeFunctor[G]constraint instead ofFunctor[F]by @armanbilge in #4115 - Add
ownPollerby @armanbilge in #4133 - Use
IO.unitinAsync[IO].unitby @iRevive in #4162 - Add default constructor for
MapRefby @yisraelU in #4139 - Add
SystemPropertiesby @massimosiani in #3924 - Make
timeout/timeoutToalways return the outcome of the effect by @biochimia in #4059 IOLocalpropagation for unsafe access by @armanbilge in #3636- Make
UUIDGenmore performant by @diogocanut in #3647 cats.mtl.Local[IO, E]fromIOLocal[E]by @rossabaker in #3429- Implement
IORuntimeMetricsby @iRevive in #3317 - Use global counter as an MBean ID for WSTP by @iRevive in #4186
- Add a
memoizedAcquiremethod toResourceby @satabin in #4105 - Add
TimerHeapMetricsby @iRevive in #4187 - Add pack count metric for
TimerHeapby @armanbilge in https://github.com/typelevel...
v3.5.7
This is the fifty-second release in the Cats Effect 3.x lineage. It is fully binary compatible with every 3.x release and fully source-compatible with every 3.5.x release.
Warning
The 3.5.x series contains some changes that may be semantically breaking with respect to earlier 3.x releases. If you're using fs2, http4s, or other libraries from the ecosystem, make sure you've upgraded to versions of these libraries that are compatible with this release (for fs2, that's 3.7.0+, for http4s it's 0.23.19+)!
Additionally, if you're using methods like fromFuture, make sure you're aware of the major changes to async, described in these release notes.
What's Changed
Enhancements
- Propagate Java thread interruption in
Dispatcher#unsafeRunSyncby @kamilkloch in #4167
Behind the Scenes
- Update versions for 3.5.6 by @samspills in #4175
Full Changelog: v3.5.6...v3.5.7
v3.5.6
This is the fifty-first release in the Cats Effect 3.x lineage. It is fully binary compatible with every 3.x release and fully source-compatible with every 3.5.x release.
Warning
The 3.5.x series contains some changes that may be semantically breaking with respect to earlier 3.x releases. If you're using fs2, http4s, or other libraries from the ecosystem, make sure you've upgraded to versions of these libraries that are compatible with this release (for fs2, that's 3.7.0+, for http4s it's 0.23.19+)!
Additionally, if you're using methods like fromFuture, make sure you're aware of the major changes to async, described in these release notes.
What's Changed
Enhancements
Bug Fixes
- Fix
sizeupdates inDequeuestate machine by @armanbilge, @reardonj in #4171
Documentation
- Fix
joinWithNeverdocs by @lenguyenthanh in #4160
Behind the Scenes
- Update versions for 3.5.5 by @armanbilge in #4154
Full Changelog: v3.5.5...v3.5.6
v3.5.5
This is the fiftieth release in the Cats Effect 3.x lineage. It is fully binary compatible with every 3.x release and fully source-compatible with every 3.5.x release.
Warning
The 3.5.x series contains some changes that may be semantically breaking with respect to earlier 3.x releases. If you're using fs2, http4s, or other libraries from the ecosystem, make sure you've upgraded to versions of these libraries that are compatible with this release (for fs2, that's 3.7.0+, for http4s it's 0.23.19+)!
Additionally, if you're using methods like fromFuture, make sure you're aware of the major changes to async, described in these release notes.
What's Changed
Enhancements
Dispatcher: avoid spinning by @durban in #4052- Relax
accesssemantics inMapRefimplementations by @armanbilge in #4116 - optimize
IO.whenAby @Jasper-M in #4135
Bug Fixes
- Fix #4066: shut down executors when
IORuntime.globalshuts down by @durban in #4067 - Use
IOApp#reportFailureinstead ofprintStackTrace()for blocking EC by @fredfp in #4044 - Fix
cancelabletoguaranteecancelation by @armanbilge in #4118
Documentation
- Update versions for 3.5.4 by @djspiewak in #4032
- Improve contributor documentation by @durban in #4038
- Expand the example of using
Random[F]in the doc for 3.5.x by @sshark in #4041 - Document usage of
-Wnonunit-statementby @froth in #4054 - link to
MapRefdocs in site sidebar by @samspills in #4122 - Add lifecycle diagrams to
Supervisorweb docs by @samspills in #4127
Behind the Scenes
- Fix CI step to post release to Discord by @armanbilge in #4031
- Create 8-core Cirrus CI job by @armanbilge in #4036
- Try to address
DispatcherSpectimeout in CI by @durban in #4057 - Pin CI to macOS 12 by @armanbilge in #4078
- Remove GraalVM from CI matrix by @mzuehlke in #4153
New Contributors
Full Changelog: v3.5.4...v3.5.5