mercury icon indicating copy to clipboard operation
mercury copied to clipboard

HG: Add hg_proc_ignore

Open mdorier opened this issue 2 years ago • 0 comments

This function would have the following prototype:

hg_return_t hg_proc_ignore(hg_proc_t proc)

If the operation is HG_ENCODE or HG_FREE, this function would do nothing. If the operation is HG_DECODE, this function would ignore the remaining data, but be correct with respect to checksums.

This would fix an issue that appears when checksum is enabled and when the deserialization function registered with an RPC is trying to do something smart, such as figuring out half-way through deserialization that the remaining data won't be needed. In this situation currently Mercury will return a checksum error. This is a pattern we currently have in Margo, where if the beginning of the message indicates an error, the rest of the message is ignored. We have that also in thallium if the user tries to do partial deserialization, in which case an exception will be thrown if Mercury returns a checksum error.

mdorier avatar Jun 09 '22 12:06 mdorier