You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by "David Smiley (JIRA)" <ji...@apache.org> on 2016/03/17 16:51:33 UTC

[jira] [Updated] (SOLR-8866) JavaBinCodec should throw an exception when serializing unknown types

     [ https://issues.apache.org/jira/browse/SOLR-8866?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

David Smiley updated SOLR-8866:
-------------------------------
    Attachment: SOLR_8866_UpdateLog_show_throw_for_unknown_types.patch

Here's a patch.  I isolated the change to TransactionLog.java and added a test.  I don't love where I put the test but I'm not sure of a more suitable place.

Originally I tried making the change on JavaBinCodec but there are a bunch of things that get serialized by BinaryResponseWriter like a Lucene Explaination, Directory, and Java Throwable.  Possibly others.  So instead of playing wack-a-mole there I limited the scope of this to where it's most important.

Tests pass.

> JavaBinCodec should throw an exception when serializing unknown types
> ---------------------------------------------------------------------
>
>                 Key: SOLR-8866
>                 URL: https://issues.apache.org/jira/browse/SOLR-8866
>             Project: Solr
>          Issue Type: Improvement
>            Reporter: David Smiley
>            Assignee: David Smiley
>         Attachments: SOLR_8866_UpdateLog_show_throw_for_unknown_types.patch
>
>
> When JavaBinCodec encounters a class it doesn't have explicit knowledge of how to serialize, nor does it implement the {{ObjectResolver}} interface, it currently serializes the object as the classname, colon, then toString() of the object.
> This may appear innocent but _not_ throwing an exception hides bugs.  One example is that the UpdateLog, which uses JavaBinCodec, to save a document.  The result is that this bad value winds up there, gets deserialized as a String in PeerSync (which uses /get) and then this value pretends to be a suitable value to the final document in the leader.  But of course it isn't.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org