Skip to content

Exceptions within dosync!! blocks not gracefully handled #5

@charles-dyfis-net

Description

@charles-dyfis-net

Modeling Clojure's STM, a user can reasonably expect an exception thrown within a dosync!! block to abort the transaction without side-effects.

This is not in fact the case.

=> (seq @(.state (avout.transaction/get-local-transaction
                  *avout-client*)))
(0 0 0 0 0 0 0 0)

=> (avout/dosync!! *avout-client*
                   (throw (RuntimeException. "FAIL!")))
run-in-transaction exception: #<RuntimeException java.lang.RuntimeException: FAIL!>
nil

=> (seq @(.state (avout.transaction/get-local-transaction
                  *avout-client*)))
(0 0 0 0 0 0 0 2)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions