Gaffer
Gaffer copied to clipboard
ProxyStore fails to deserialise JSON for Operations with a generic output type
An OperationChain consisting of [GetElements, Limit(10)] has a generic output type of Iterable<T>. This means the Proxy Store doesn't know to deserialise the objects into Elements.
Current status: To resolve a useful output type from a list of Operation
s in an OperationChain
, the getOutputTypeReference will:
Iterate through the operations in reverse
Search for implementations of Output
Ignore any with TypeReference
s of type TypeReferenceImpl.IterableObj
(since this doesn't really help for deserialisation)
Return the TypeReference
closest to the end of the chain if present, otherwise TypeReferenceImpl.Void
Whomever picks this up, feel free to reuse, change, or remove the above.
@GCHQDev404 Is this issue still valid or has this been fixed by other work?
After discussion offline, this bug is probably unaffected by fedstore rewrite and/or maestro. After maestro has been merged, revisit this bug and fix for alpha-5.
@GCHQDev404: "why is proxy even trying to deserialise it" @d21211122: "there are some tricks played with the generics so that when you construct operation chains with the builders, you get the correct generic types and the code will run correctly... but you lose those generics whenever that object is serialised" GCHQDev404: "some of those generics was getting ripped out" d21211122: "i suspect the issue is more about whether the output of one operation can be chained to another one without it failing".
A test needs to be written to examine if this bug still exists.
There appears to be some issues with such as #2806 where proxy store is having issues deserialising. Originally this was useful because the the Proxy could examine if it could or should handle something locally. In the real world maybe this is never used.
Maybe it would be simpler if proxy store or version of it was completely gutted out and forwards without deserialising anything.
This has been tested on a Rest service Federation Container with a Proxy to a Accumulo Store Container. And it works without issue. Testings is required for Java API but this deprioritised to after V2.