-
Type:
Task
-
Resolution: Unresolved
-
Priority:
Major - P3
-
None
-
Affects Version/s: None
-
Component/s: None
-
Query Integration
-
None
-
None
-
None
-
None
-
None
-
None
-
None
Currently, some Handles (ex: ExecAggStageHandle) use NonNull and others don't (ex: HostPortalHandle).
absl::Nonnull usage does not protect against crashes where functions are called on moved handles. For example, santiago.roche@mongodb.com gave this example:
Handle<Dummy> handle{ptr}; // ptr has been allocated
doFunctionTransferringOwnership(std::move(handle)); // we move the handle
handle.doFoo(); // what happens here? We'll segfault for sure.
To avoid this, one option is to always call assertValid() when functions are called on a handle. If this is done, then usage of absl::Nonnull can probably be done away with. This should be discussed further.