Fix DuckTypeFieldIsReadonlyException in RabbitMQ v7+ auto-instrumentation#8006
Merged
Fix DuckTypeFieldIsReadonlyException in RabbitMQ v7+ auto-instrumentation#8006
DuckTypeFieldIsReadonlyException in RabbitMQ v7+ auto-instrumentation#8006Conversation
Execution-Time Benchmarks Report ⏱️Execution-time results for samples comparing This PR (8006) 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 (8006) - mean (69ms) : 67, 71
master - mean (69ms) : 67, 70
section Bailout
This PR (8006) - mean (72ms) : 71, 73
master - mean (72ms) : 72, 73
section CallTarget+Inlining+NGEN
This PR (8006) - mean (1,008ms) : 956, 1059
master - mean (1,016ms) : 947, 1084
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 (8006) - mean (106ms) : 103, 108
master - mean (106ms) : 104, 108
section Bailout
This PR (8006) - mean (107ms) : 106, 108
master - mean (107ms) : 105, 108
section CallTarget+Inlining+NGEN
This PR (8006) - mean (708ms) : 680, 735
master - mean (712ms) : 673, 752
FakeDbCommand (.NET 6)gantt
title Execution time (ms) FakeDbCommand (.NET 6)
dateFormat x
axisFormat %Q
todayMarker off
section Baseline
This PR (8006) - mean (93ms) : 91, 95
master - mean (94ms) : 92, 96
section Bailout
This PR (8006) - mean (94ms) : 93, 95
master - mean (94ms) : 93, 95
section CallTarget+Inlining+NGEN
This PR (8006) - mean (664ms) : 643, 684
master - mean (665ms) : 642, 688
FakeDbCommand (.NET 8)gantt
title Execution time (ms) FakeDbCommand (.NET 8)
dateFormat x
axisFormat %Q
todayMarker off
section Baseline
This PR (8006) - mean (92ms) : 90, 95
master - mean (92ms) : 89, 94
section Bailout
This PR (8006) - mean (94ms) : 90, 97
master - mean (93ms) : 92, 94
section CallTarget+Inlining+NGEN
This PR (8006) - mean (631ms) : 618, 645
master - mean (631ms) : 614, 649
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 (8006) - mean (195ms) : 190, 200
master - mean (194ms) : 189, 199
section Bailout
This PR (8006) - mean (198ms) : 195, 200
master - mean (198ms) : 195, 200
section CallTarget+Inlining+NGEN
This PR (8006) - mean (1,113ms) : 1063, 1164
master - mean (1,130ms) : 1045, 1215
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 (8006) - mean (280ms) : 271, 288
master - mean (277ms) : 272, 283
section Bailout
This PR (8006) - mean (279ms) : 274, 283
master - mean (278ms) : 275, 281
section CallTarget+Inlining+NGEN
This PR (8006) - mean (911ms) : 866, 957
master - mean (911ms) : 868, 955
HttpMessageHandler (.NET 6)gantt
title Execution time (ms) HttpMessageHandler (.NET 6)
dateFormat x
axisFormat %Q
todayMarker off
section Baseline
This PR (8006) - mean (271ms) : 265, 277
master - mean (272ms) : 266, 278
section Bailout
This PR (8006) - mean (270ms) : 266, 275
master - mean (271ms) : 267, 274
section CallTarget+Inlining+NGEN
This PR (8006) - mean (895ms) : 844, 945
master - mean (891ms) : 847, 935
HttpMessageHandler (.NET 8)gantt
title Execution time (ms) HttpMessageHandler (.NET 8)
dateFormat x
axisFormat %Q
todayMarker off
section Baseline
This PR (8006) - mean (272ms) : 264, 279
master - mean (271ms) : 266, 275
section Bailout
This PR (8006) - mean (274ms) : 265, 283
master - mean (273ms) : 267, 278
section CallTarget+Inlining+NGEN
This PR (8006) - mean (829ms) : 807, 852
master - mean (827ms) : 811, 844
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary of changes
Fixes a
DuckTypeFieldIsReadonlyExceptionhappening in the RabbitMQ v7+ instrumentation whenBasicPublishis called withCachedStrings.Reason for change
https://github.com/rabbitmq/rabbitmq-dotnet-client/blob/94147996821f6a77bed0e77fd1886e75b08a31f9/projects/RabbitMQ.Client/CachedString.cs#L16
is defined as
readonlyOur DuckType had was a
get/setproperty.When calling
BasicPublishwithCachedStringwe'd get the following error:Implementation details
Removed the
set.Test coverage
So, I updated the sample application to make a call with
CachedStrings on V7+ instead of the normalstringcalls. So no new spans, we would expect the spans to be the same and they are.Without this fix (removing the
set) the tests fail as the snapshots are different for V7. I didn't think it was super valuable to update the sample application to call both versions ofBasicPublishfor V7 (one withCachedStringand one without) asBasicPublishAsyncCachedStringsIntegrationjust callsreturn BasicPublishAsyncIntegration.OnMethodBeginso 🤷Other details
Fixes this error identified by Error Tracking