Skip to content

Releases: zio/zio

2.1.12

07 Nov 05:23
f092e25

Choose a tag to compare

This release brings a couple bug fixes for STM, as well as a few optimizations and usability improvements.

What's Changed

Other changes (CI, dependencies and documentation)

2.1.11

10 Oct 13:06
6362961

Choose a tag to compare

We found a regression in 2.1.10 causing a runtime exception in some cases when using ZIO environment and layers, so here's a release to fix that.

What's Changed

  • Fix IndexOutOfBoundsException when using reverseIterator on UpdateOrderLinkedMap by @kyri-petrou in #9239

2.1.10

10 Oct 06:50
66fcbd1

Choose a tag to compare

This release brings a few important bug fixes related to ZPool and ZSTM as well as some optimizations. It also fixes a binary incompatibility that caused runtime errors when using an older version ZIO Streams together with ZIO 2.1.9.

Important note about ZPool changes

There are 2 fixes / changes to ZPool that might affect the behaviour of an application so users are advised to revise the following in cases of unexpected behaviour after upgrading to ZIO 2.1.10+.

Eager / strict initialization of ZPool's resources

In previous ZIO versions, the initialization of ZPool resources was done lazily in a daemon fiber. e.g., this code would previously print the message, but will now "hang" awaiting for the pool to be initialized to its full size:

ZPool.make(ZIO.never, 10) *> ZIO.debug("Pool initialized")

We believe that this change makes the behaviour of ZPool more predictable (and referentially transparent!) as previously there were no guarantees that the ZPool resources would be initialized during the creation of the pool. However, this might result in the initialization of the pool hanging in cases that the acquisition of the resources itself hangs. Therefore users are advised to consider adding timeouts to the resource initialization effect.

Strict finalization of ZPool resources

In previous versions, it was possible for the ZPool finalizers to be interrupted, which would lead to potential leak of resources (see this issue for more info). Starting with ZIO 2.1.10+, closing a ZPool requires all of the resource finalizers to finish first. As with (1), this might lead to some unexpected behaviour if the finalization of a resource hangs indefinitely, so users are advised to add timeouts to the finalizers of resources used with ZPool.

What's Changed

Other changes (CI, dependencies and documentation)

  • chore(deps): update dependency @types/react to v18.3.5 by @renovate in #9154
  • fix(deps): update dependency postcss to v8.4.42 by @renovate in #9156
  • Restyling welcome page by @SvMak in #9112
  • fix(deps): update dependency postcss to v8.4.43 by @renovate in #9158
  • fix(deps): update dependency postcss to v8.4.44 by @renovate in #9159
  • Add zio-apache-parquet to ecosystem community docs by @grouzen in #9157
  • fix(deps): update dependency postcss to v8.4.45 by @renovate in #9169
  • fix(deps): update dependency @zio.dev/zio-prelude to v1.0.0-rc31 by @renovate in #9171
  • Set JDK release version to 11 by @kyri-petrou in #9177
  • fix(deps): update dependency @zio.dev/zio-http to v3.0.0 by @renovate in #9190
  • Fix logo resolution by @SvMak in #9188
  • fix(deps): update dependency postcss to v8.4.47 by @renovate in #9196
  • fix(deps): update dependency tailwindcss to v3.4.11 by @renovate in #9192
  • fix(deps): update dependency @zio.dev/zio-query to v0.7.6 by @renovate in #9197
  • chore(deps): update dependency @types/react to v18.3.6 by @renovate in #9198
  • Documentation: Fix The Link to OpenTracing Documentation Page by @khajavi in #9161
  • chore(deps): update dependency @types/react to v18.3.7 by @renovate in #9199
  • fix(deps): update dependency @zio.dev/zio-http to v3.0.1 by @renovate in #9200
  • fix(deps): update dependency @zio.dev/zio-bson to v1.0.7 by @renovate in #9201
  • fix(deps): update dependency @zio.dev/zio-schema to v1.5.0 by @renovate in #9204
  • fix(deps): update dependency tailwindcss to v3.4.12 by @renovate in #9202
  • chore(deps): update dependency @types/react to v18.3.8 by @renovate in #9206
  • Remove mention of discontinued tools by @namingbe in #9213
  • Typos in zpipeline.md by @dubinsky in #9219
  • fix(deps): update dependency tailwindcss to v3.4.13 by @renovate in #9216
  • chore(deps): update dependency prettier-plugin-tailwindcss to v0.6.8 by @renovate in #9218
  • chore(deps): update dependency @types/react to v18.3.9 by @renovate in #9217
  • Doc: Update info about Java versions supported by @guizmaii in #9224
  • chore(deps): update dependency @types/react to v18.3.11 by @renovate in #9225
  • Doc: Needs to use serviceWithZIO not serviceWith by @fancellu in #9226
  • fix(deps): update dependency @zio.dev/zio-lambda to v1.0.5 by @renovate in #9230
  • Fix documentation for TestLens#right by @callado4 in #9232

2.1.9

29 Aug 02:59
dd98613

Choose a tag to compare

After receiving multiple reports of users failing to compile code using ZLayer macros with v2.1.8, we decided to temporarily revert #9077 until we get to bottom of what's been causing it.

What's Changed

Full Changelog: v2.1.8...v2.1.9

2.1.8

24 Aug 10:29
e5341e1

Choose a tag to compare

This release brings a re-implemented ZSTM runtime that significantly improves performance under contention, enables multi-threading for Scala Native 0.5.x, squashes some minor bugs, and makes a few things run a little bit faster. And it is fully binary and source-compatible with the rest of 2.x release!

Highlights

ZSTM performance improvements

The performance of ZSTM under heavy contention has regressed over time due to various bug fixes. In this release, we reimplemented the internal runtime of ZSTM in order to significantly improve its performance under heavy contention (up to 800% improved throughput in some benchmarks!) all while achieving similar or better performance under no contention. For more details check out #9081

Scala Native multi-threading support

In the previous release, we updated Scala Native to v0.5.x but as we mentioned in the release notes, the ZIO runtime was not yet multi-threading capable. In this release, we threw most of the existing Scala Native code (which was not thread-safe) and changed it to use (mostly) the same code as the JVM artifacts. Users that currently use ZIO with Scala Native 0.5.x must enable multi-threading for Scala Native in their builds by removing nativeConfig ~= { _.withMultithreading(false) }.

Warning

We're aware of an issue when using zio-test on MacOS ARM64 when the debug compilation mode is used (default). If you come across any issues, try setting the mode to releaseFast or releaseFull (see here for an example)

What's Changed

Other changes (CI, dependencies and documentation)

2.1.7

05 Aug 09:53
164a60e

Choose a tag to compare

This release adds support for Scala Native 0.5, contains various bug fixes as well as performance optimizations.

Highlights

Scala Native 0.5 support

This version of ZIO is released using Scala Native 0.5, which means that libraries that depend on ZIO can now also update their Scala Native version. Special thanks to @sideeffffect for his work on this 🎉

Warning

At the moment, ZIO is not yet fully compatible for use with Scala Native's multi-threading feature. We are planning on adding support for it soon, but until then, users are encouraged to disable it using nativeConfig ~= { _.withMultithreading(false) } in their project config.

Fix memory leaks in parallel ZStream processing methods

In v2.1.3 we did a number of optimizations to parallel ZStream processing. Unfortunately, since then we received a number of reports where users experienced memory leaks, which we managed to trace back to these optimizations. While we managed to patch a number of these issues in subsequent releases, we weren't able to fully eliminate them and therefor we made the decision to temporarily revert them back to their pre-v2.1.3 implementation. We are planning be revisiting optimizations for these methods in a future release but this time ensuring that they don't lead to memory leaks for edge-case usage patterns.

Tip

Based on the reports we received, it appears that many users use unbounded parallelism (i.e., n = Int.MaxValue) in ZStream's *Par methods. To improve performance of these methods, we highly encourage users the following:

  • Use a finite parallelism limit for ZStream's*Par methods. The limit needs to make sense for the workflow and system's resources. If unsure on what value to use, you can use these values as a vague starting point:
    i. CPU-bounded workflow: n = nCPU
    ii. IO-bounded: workflow n = nCPU x ~8-16
  • If overriding the buffer size, use a relatively small value (i.e., <= 16)
  • Use a power of 2 value for both parallelism and buffer sizes

What's Changed

Other changes (CI, dependencies and documentation)

2.1.6

10 Jul 06:49
9a2f76b

Choose a tag to compare

This minor release contains a few important bug fixes and optimizations to improve performance. The most notable fix was done in #8997 which fixed a potential memory leak when using ZStream#mapZIOParUnordered.

What's Changed

Other changes (CI, dependencies and documentation)

2.1.5

28 Jun 00:43
c813e57

Choose a tag to compare

This minor release contains a bug fix and a few improvements. The most meaningful improvement is that we now try to detect when an asynchronous effect is run from inside another ZIO effect via Runtime.unsafe.run (which is an anti-pattern! but happens in the wild) and move it automatically to the blocking threadpool to prevent deadlocks.

What's Changed

Other changes (CI, dependencies and documentation)

  • fix(deps): update dependency @zio.dev/zio-sbt to v0.4.0-alpha.28 by @renovate in #8969
  • fix(deps): update dependency @zio.dev/zio-json to v0.7.1 by @renovate in #8977
  • fix(deps): update dependency @zio.dev/zio-query to v0.7.2 by @renovate in #8968

New Contributors

Full Changelog: 2.1.4...v2.1.5

2.1.4

20 Jun 03:32
1eb33c2

Choose a tag to compare

This minor release contains 2 important bug fixes to ZStream parallel operations and ZLayer derivation. It also contains some performance improvements to ZStream and the new methods to ZIO that improve UX.

What's Changed

Other changes (CI, dependencies and documentation)

  • fix(deps): update dependency @zio.dev/zio-kafka to v2.7.5 by @renovate in #8929
  • Add test for mapZIOPar and mapZIOParUnordered for parallelism respected by @narma in #8940

Full Changelog: v2.1.3...2.1.4

2.1.3

12 Jun 03:35
f6c7d39

Choose a tag to compare

This minor release contains an important fix to a regression introduced in v2.1.2, where ZEnvironment#prune throws an error in cases where a class implements multiple services. This regression is most likely to be observed during ZLayer composition during app initialization, but users that have updated to v2.1.2 are still advised to update to v2.1.3 as soon as possible.

In addition, this release also contains performance improvements to ZStream and Chunk, as well as some minor bug fixes.

What's Changed

Other changes (CI, dependencies and documentation)