Skip to content

Commit

Permalink
[v4] Disable issue-83 workaroud by default
Browse files Browse the repository at this point in the history
  • Loading branch information
ptaoussanis committed Sep 18, 2024
1 parent ffdfefc commit ce93e0a
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 8 deletions.
16 changes: 9 additions & 7 deletions src/taoensso/carmine_v4.clj
Original file line number Diff line number Diff line change
Expand Up @@ -195,15 +195,17 @@

(def ^:dynamic *issue-83-workaround?*
"TODO Docstring incl. env config.
A bug in Carmine v2.6.0 to v2.6.1 (2014-04-01 to 2014-05-01)
caused Nippy blobs to be marked incorrectly (with `ba-bin` instead
of `ba-npy`), Ref. <https://github.com/ptaoussanis/carmine/issues/83>
Only relevant if `*auto-thaw?` is true.
This should be kept true (the default) if there's a chance you might
read any data written by Carmine < v2.6.1 (2014-05-01).
A bug in Carmine v2.6.0 to v2.6.1 (2014-04-01 to 2014-05-01) caused Nippy blobs
to be marked incorrectly, Ref. <https://github.com/ptaoussanis/carmine/issues/83>
Only relevant if `*auto-thaw?` is true."
(enc/get-env {:as :bool, :default true}
When enabled, this workaround will cause Carmine to automatically try thaw any
reply byte data that starts with a valid Nippy header.
Enable iff you might read data written by Carmine < v2.6.1 (2014-05-01).
Disabled by default."
(enc/get-env {:as :bool, :default false}
:taoensso.carmine.issue-83-workaround))

(def ^:dynamic *conn-cbs*
Expand Down
3 changes: 2 additions & 1 deletion test/taoensso/carmine_v4/tests/resp.clj
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@
(is (= (test-blob-?marker "\u0000_more") [:nil "more"]))
(is (= (test-blob-?marker "\u0000>more") [:npy "more"]))
(is (= (test-blob-?marker "\u0000<more") [:bin "more"]))
(is (= (test-blob-?marker "\u0000<NPYmore") [:npy "NPYmore"]))
(binding [core/*issue-83-workaround?* true ] (is (= (test-blob-?marker "\u0000<NPYmore") [:npy "NPYmore"])))
(binding [core/*issue-83-workaround?* false] (is (= (test-blob-?marker "\u0000<NPYmore") [:bin "NPYmore"])))
(is (= (test-blob-?marker "\u0000<NPmore") [:bin "NPmore"]))
(is (= (test-blob-?marker "\u0000<Nmore") [:bin "Nmore"]))])

Expand Down

0 comments on commit ce93e0a

Please sign in to comment.