Skip to content

v5.1.1

Choose a tag to compare

@shadowsmind shadowsmind released this 07 Nov 09:03
· 9 commits to main since this release

mongo4s 5.1.1

Two fixes: a hang on large replies, which every runtime hits, and how kyo reports a cancellation. Binary compatible
with 5.0.0 and 5.1.0, checked by MiMa with no exclusions.

libraryDependencies += "org.mongo4s" %% "mongo4s-core" % "5.1.1"

Bug fixes

  • A large reply read in many small pieces hung the call. MongoDB driver 5.6.0 to 5.13.0 nests one callback
    per partial socket read of a reply and unwinds them all at once when the reply is complete. About 900 reads
    overflow the stack of the driver's I/O thread. The StackOverflowError never reaches the caller, so the find
    waits forever (JAVA-6313). A link that delivers a few kilobytes per
    read is enough to trigger it: TLS does, and so does Docker Desktop's host.docker.internal, where a 3.5 MB reply
    took over 1,500 reads. mongo4s now depends on driver 5.14.0, which reads in a loop instead.
  • On kyo, guaranteeCase and bracketCase reported a cancellation as an error. kyo 1.0.0-RC7 abandons a fiber
    interrupted while it waits and closes its scope with KyoException("fiber abandoned"). The finalizer therefore saw
    ExitCase.Errored instead of ExitCase.Canceled. Transactions still rolled back, but code that tells the two cases
    apart counted every timeout as a failure. The finalizer now sees Canceled.

Dependencies

  • mongodb-driver-reactivestreams, mongodb-driver-core and bson 5.14.0. A build that pins its own org.mongodb
    jars needs 5.14.0 or later, or it still hangs.

Build

  • LargeReplyItSpec reads a 3 MB batch through a proxy that passes the server's answer on a kilobyte at a time. On
    5.13.0 it times out with the overflow in the log; on 5.14.0 it passes.
  • cats, zio and kyo each have a spec that interrupts a body inside guaranteeCase; none did before.