-
Notifications
You must be signed in to change notification settings - Fork 151
Add #nullable enable and fix NullReferenceException in DynamoDB
#7849
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Execution-Time Benchmarks Report ⏱️Execution-time results for samples comparing This PR (7849) and master. ✅ No regressions detected - check the details below Full Metrics ComparisonFakeDbCommand
HttpMessageHandler
Comparison explanationExecution-time benchmarks measure the whole time it takes to execute a program, and are intended to measure the one-off costs. Cases where the execution time results for the PR are worse than latest master results are highlighted in **red**. The following thresholds were used for comparing the execution times:
Note that these results are based on a single point-in-time result for each branch. For full results, see the dashboard. Graphs show the p99 interval based on the mean and StdDev of the test run, as well as the mean value of the run (shown as a diamond below the graph). Duration chartsFakeDbCommand (.NET Framework 4.8)gantt
title Execution time (ms) FakeDbCommand (.NET Framework 4.8)
dateFormat x
axisFormat %Q
todayMarker off
section Baseline
This PR (7849) - mean (75ms) : 70, 79
master - mean (76ms) : 71, 81
section Bailout
This PR (7849) - mean (80ms) : 75, 85
master - mean (80ms) : 75, 85
section CallTarget+Inlining+NGEN
This PR (7849) - mean (1,113ms) : 1057, 1169
master - mean (1,117ms) : 1038, 1196
FakeDbCommand (.NET Core 3.1)gantt
title Execution time (ms) FakeDbCommand (.NET Core 3.1)
dateFormat x
axisFormat %Q
todayMarker off
section Baseline
This PR (7849) - mean (118ms) : 112, 124
master - mean (118ms) : 110, 125
section Bailout
This PR (7849) - mean (118ms) : 113, 123
master - mean (118ms) : 111, 125
section CallTarget+Inlining+NGEN
This PR (7849) - mean (796ms) : 752, 839
master - mean (800ms) : 758, 841
FakeDbCommand (.NET 6)gantt
title Execution time (ms) FakeDbCommand (.NET 6)
dateFormat x
axisFormat %Q
todayMarker off
section Baseline
This PR (7849) - mean (105ms) : 99, 112
master - mean (104ms) : 97, 111
section Bailout
This PR (7849) - mean (105ms) : 100, 111
master - mean (107ms) : 100, 114
section CallTarget+Inlining+NGEN
This PR (7849) - mean (745ms) : 713, 777
master - mean (754ms) : 711, 797
FakeDbCommand (.NET 8)gantt
title Execution time (ms) FakeDbCommand (.NET 8)
dateFormat x
axisFormat %Q
todayMarker off
section Baseline
This PR (7849) - mean (102ms) : 96, 109
master - mean (104ms) : 98, 110
section Bailout
This PR (7849) - mean (105ms) : 98, 113
master - mean (104ms) : 99, 109
section CallTarget+Inlining+NGEN
This PR (7849) - mean (706ms) : 680, 732
master - mean (715ms) : 689, 740
HttpMessageHandler (.NET Framework 4.8)gantt
title Execution time (ms) HttpMessageHandler (.NET Framework 4.8)
dateFormat x
axisFormat %Q
todayMarker off
section Baseline
This PR (7849) - mean (192ms) : 188, 197
master - mean (192ms) : 188, 197
section Bailout
This PR (7849) - mean (196ms) : 193, 198
master - mean (195ms) : 193, 198
section CallTarget+Inlining+NGEN
This PR (7849) - mean (1,175ms) : 1104, 1246
master - mean (1,169ms) : 1105, 1232
HttpMessageHandler (.NET Core 3.1)gantt
title Execution time (ms) HttpMessageHandler (.NET Core 3.1)
dateFormat x
axisFormat %Q
todayMarker off
section Baseline
This PR (7849) - mean (277ms) : 269, 285
master - mean (279ms) : 274, 284
section Bailout
This PR (7849) - mean (277ms) : 272, 283
master - mean (277ms) : 273, 281
section CallTarget+Inlining+NGEN
This PR (7849) - mean (947ms) : 903, 991
master - mean (947ms) : 911, 984
HttpMessageHandler (.NET 6)gantt
title Execution time (ms) HttpMessageHandler (.NET 6)
dateFormat x
axisFormat %Q
todayMarker off
section Baseline
This PR (7849) - mean (270ms) : 266, 274
master - mean (271ms) : 266, 275
section Bailout
This PR (7849) - mean (270ms) : 265, 274
master - mean (270ms) : 265, 274
section CallTarget+Inlining+NGEN
This PR (7849) - mean (928ms) : 876, 979
master - mean (931ms) : 882, 979
HttpMessageHandler (.NET 8)gantt
title Execution time (ms) HttpMessageHandler (.NET 8)
dateFormat x
axisFormat %Q
todayMarker off
section Baseline
This PR (7849) - mean (269ms) : 266, 273
master - mean (270ms) : 265, 274
section Bailout
This PR (7849) - mean (269ms) : 265, 274
master - mean (269ms) : 265, 274
section CallTarget+Inlining+NGEN
This PR (7849) - mean (852ms) : 829, 874
master - mean (857ms) : 836, 879
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
NachoEchevarria
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice! Thanks!
| var tableName = request.TableName; | ||
| try | ||
| { | ||
| var keys = request.Keys.DuckCast<IDynamoDbKeysObject>(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thought this was a possible null reference exception scenario, but then, realized that:
public static T? DuckCast()
|
|
||
| // TableName tagging only when batch is from one table. | ||
| var iterator = request.RequestItems.GetEnumerator(); | ||
| using var disposable = iterator as IDisposable; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cool trick
| /// https://github.com/aws/aws-sdk-net/blob/main/sdk/src/Services/DynamoDBv2/Generated/Model/UpdateItemRequest.cs | ||
| /// https://github.com/aws/aws-sdk-net/blob/main/sdk/src/Services/DynamoDBv2/Generated/Model/DeleteItemRequest.cs |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks!
lucaspimentel
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
Summary of changes
#nullable enableto a bunch of filesNullReferenceExceptionin DynamoDB integrationsReason for change
While looking at logs, spotted null reference exception in DynamoDB integration. Adding
#nullable enable(and being conservative about what could be null) revealed multiple casesImplementation details
#nullable enableto DynamoDB duck types and integrationsTest coverage
Should be covered by existing. These are generally edge cases
Other details
Made other cosmetic changes too, removing unnecessary comments and namespaces etc. Recommend commit-by-commit review for simplicity (bug-fixes are isolated to a single commit)