-
Type: Task
-
Resolution: Fixed
-
Priority: Major - P3
-
Affects Version/s: 6.3.0-rc1
-
Component/s: None
-
None
-
Serverless
-
Fully Compatible
-
Server Serverless 2023-03-06, Server Serverless 2023-03-20
While we can pass SerializationContext via the IDLContextParser when constructing structs via their parseProtected() calls, this is not the only way these structs are constructed. In some cases, we call the parameterized constructors directly, which builds an unpopulated structure. We still need to set the local SerializationContext held in the nested structures at all levels, which is set by the top-level enclosing class, and this needs to be done via the intializer lists.
The flags should be set in the following priority order:
- Overriden by a valid set of SerializationContext being passed in
- Via the top-level enclosing class (as determined by the IDL configuration)
- Default if not a top-level enclosing class
Case 1 will allow us to both override when explicitly passing flags in in our manual calls, as well as for nested structures to prioritize flags being passed in by their enclosing class.
The above priority list applies to setting the local SerializationContext var, but because the state of these flags will be passed to nestesd structs, we to need to first set the local copy of SerializationContext before any nested structs, which means reordering the flags both in the initializer list and in the declaration.
One thing to note is that we can't guarantee the flags exist at all levels without calling parse() because some of the nested structures are constructed manually by the callers, especially those that can't be determined at compile time (such as containerized objetcs). In these cases, the responsibility of setting the flags remains with the caller, otherwise case 3 applies (and may be incorrect).
- is depended on by
-
SERVER-74284 Fix existing tests for command serialization/deserialization
- Closed