Closed rsslldnphy closed 9 years ago
You are correct, Spyglass performs no serialisation.
Yes I see that. As I said I created an issue here as I thought you might be able to offer some help? It doesn't happen for plain booleans, only for Clojure datastructures that contain them. Have you never run into any Clojure-specific serialization problems that might provide a hint as to where to look for the problem?
I also asked here because it's Clojure users that will be affected by this bug - I imagined posting an issue on the Java project would elicit a shrug. But I will post there as well.
SpyMemcached has transcoders and you should be able to provide your own. Let me know if you find a solution as I'd be happy to use a different default transcoder in Spyglass.
Aye, I think I've tracked it down in SerializingTranscoder
.
Would there be anything wrong with just doing a pr-str
before sending to spymemcached and an edn/read-string
after reading back? I can't think of any obvious sensible cases where you'd want to cache, from Clojure, data that couldn't be serialized as EDN (but there may well be cases I haven't thought of of course).
Upgrading to a version that did this would invalidate any data currently in memcached, but I think that would happen with almost any transcoder change.
I can't think of any other sensible approaches, so if this doesn't sound like an option I'll at least get together a pull request to add a warning to the docs to say you should make sure to apply your choice of serialization for compound values.
Hi, I'm pretty sure this is a bug in the upstream project rather than this one, but I'm raising an issue here as I think you may be able to help as it seems Clojure specific.
If you persist an EDN value that contains a boolean into memcached, when you read it in, the boolean is deserialized as a new instance of java.lang.Boolean - so a false value is not
identical?
tofalse
, which breaksif
,when
etc. This doesn't happen when you persist just a boolean by itself - so it seems to be something to do with the serialization/deserialization of EDN.Here's a REPL session to illustrate what I mean: