Azure / azure-functions-durable-extension

Durable Task Framework extension for Azure Functions
MIT License
714 stars 270 forks source link

Add Nullability Checks for robustness #1635

Open davidmrdavid opened 3 years ago

davidmrdavid commented 3 years ago

Is your feature request related to a problem? Please describe. We have recently had a handful of time-consuming investigations where a customer experienced a framework-internal null-ptr exception. Some of these were relatively trivial, function-local, errors.

Describe the solution you'd like I would like our codebase to be resilient to these errors by utilizing C#'s nullability types. This may be a rather expensive, time-consuming, refactoring, but there's evidence to believe it'll pay off in future investigations.

Describe alternatives you've considered N/A

Additional context N/A

davidmrdavid commented 3 years ago

A good place to start is in OnProcessWorkItemAsync of DurableTask. In particular, we've had issues with its instanceState local variable becoming null

ConnorMcMahon commented 3 years ago

For reference @davidmrdavid, nullable reference types are "all-or-nothing" on a csproj file layer, hence why it is so much work to implement. We would probably go project-by-project, starting at the bottom layer (DurableTask.Core) so that we don't need to duplicate effort.