Skip to content

Fun Times With Booleans #11

@joinr

Description

@joinr

I ran into the fascinating case, where a boolean false was truthy according to clojure. Specifically, only when running on a node on the cluster (evaluating a task with some maps that were serialized as part of the task). The net effect is:

user> (if (java.lang.Boolean. false) "this should never occur" "this should always occur")
"this should never occur"

On the thread where the input map was created (with some boolean values), everything is fine. On cluster though, I am guessing that the serialization process invokes (java.lang.Boolean. false) instead of using the specific java.lang.Boolean/FALSE (which clojure seems to expect). This manifested in a filter using :Enabled allowing items with {:Enabled false} to pass, when invoked on a cluster peer.

Any ideas on how to work around this at the serialization level? From what I saw, all your stuff just uses the default Serializable interface and ships stuff over the wire. I have a specific fix for this case, but I wonder if there is a general alteration to the serialization path that can catch this.

Relevant thread:

https://groups.google.com/g/cascading-user/c/6N99titgkjY?pli=1

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