Skip to content
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

Don't fail uninstall if the GAC lib has additional references #6698

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

andrewlock
Copy link
Member

Summary of changes

Don't fail uninstall if the GAC assembly has additional references

Reason for change

The GAC won't remove a file if it has additional install references. This happens if you try to register the same assembly name (name + version) with multiple paths. If you do this, then when you call uninstall with the path, the uninstall will return IASSEMBLYCACHE_UNINSTALL_DISPOSITION_HAS_INSTALL_REFERENCES because the file isn't removed. But this isn't really a fail from our PoV - the file will be cleaned up later when all the references are removed.

Implementation details

Handle the IASSEMBLYCACHE_UNINSTALL_DISPOSITION_HAS_INSTALL_REFERENCES case explicitly and treat it as a success

Test coverage

I will write tests soon, I promise

@andrewlock andrewlock added type:enhancement Improvement to an existing feature area:ssi labels Feb 21, 2025
@andrewlock andrewlock requested a review from a team as a code owner February 21, 2025 15:14
@andrewlock
Copy link
Member Author

Execution-Time Benchmarks Report ⏱️

Execution-time results for samples comparing the following branches/commits:

Execution-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 shown in red. The following thresholds were used for comparing the execution times:

  • Welch test with statistical test for significance of 5%
  • Only results indicating a difference greater than 5% and 5 ms are considered.

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).

gantt
    title Execution time (ms) FakeDbCommand (.NET Framework 4.6.2) 
    dateFormat  X
    axisFormat %s
    todayMarker off
    section Baseline
    This PR (6698) - mean (69ms)  : 67, 71
     .   : milestone, 69,
    master - mean (70ms)  : 65, 75
     .   : milestone, 70,

    section CallTarget+Inlining+NGEN
    This PR (6698) - mean (1,002ms)  : 974, 1031
     .   : milestone, 1002,
    master - mean (1,001ms)  : 976, 1025
     .   : milestone, 1001,

Loading
gantt
    title Execution time (ms) FakeDbCommand (.NET Core 3.1) 
    dateFormat  X
    axisFormat %s
    todayMarker off
    section Baseline
    This PR (6698) - mean (102ms)  : 99, 105
     .   : milestone, 102,
    master - mean (102ms)  : 100, 105
     .   : milestone, 102,

    section CallTarget+Inlining+NGEN
    This PR (6698) - mean (676ms)  : 660, 691
     .   : milestone, 676,
    master - mean (725ms)  : 664, 787
     .   : milestone, 725,

Loading
gantt
    title Execution time (ms) FakeDbCommand (.NET 6) 
    dateFormat  X
    axisFormat %s
    todayMarker off
    section Baseline
    This PR (6698) - mean (89ms)  : 86, 91
     .   : milestone, 89,
    master - mean (100ms)  : 92, 109
     .   : milestone, 100,

    section CallTarget+Inlining+NGEN
    This PR (6698) - mean (632ms)  : 612, 652
     .   : milestone, 632,
    master - mean (690ms)  : 654, 726
     .   : milestone, 690,

Loading
gantt
    title Execution time (ms) HttpMessageHandler (.NET Framework 4.6.2) 
    dateFormat  X
    axisFormat %s
    todayMarker off
    section Baseline
    This PR (6698) - mean (191ms)  : 186, 196
     .   : milestone, 191,
    master - mean (191ms)  : 187, 194
     .   : milestone, 191,

    section CallTarget+Inlining+NGEN
    This PR (6698) - mean (1,110ms)  : 1081, 1138
     .   : milestone, 1110,
    master - mean (1,106ms)  : 1081, 1132
     .   : milestone, 1106,

Loading
gantt
    title Execution time (ms) HttpMessageHandler (.NET Core 3.1) 
    dateFormat  X
    axisFormat %s
    todayMarker off
    section Baseline
    This PR (6698) - mean (270ms)  : 267, 274
     .   : milestone, 270,
    master - mean (270ms)  : 266, 275
     .   : milestone, 270,

    section CallTarget+Inlining+NGEN
    This PR (6698) - mean (864ms)  : 837, 892
     .   : milestone, 864,
    master - mean (865ms)  : 835, 894
     .   : milestone, 865,

Loading
gantt
    title Execution time (ms) HttpMessageHandler (.NET 6) 
    dateFormat  X
    axisFormat %s
    todayMarker off
    section Baseline
    This PR (6698) - mean (262ms)  : 257, 267
     .   : milestone, 262,
    master - mean (262ms)  : 258, 266
     .   : milestone, 262,

    section CallTarget+Inlining+NGEN
    This PR (6698) - mean (846ms)  : 813, 880
     .   : milestone, 846,
    master - mean (847ms)  : 813, 881
     .   : milestone, 847,

Loading

@andrewlock
Copy link
Member Author

Benchmarks Report for tracer 🐌

Benchmarks for #6698 compared to master:

  • 5 benchmarks are slower, with geometric mean 1.155
  • All benchmarks have the same allocations

The following thresholds were used for comparing the benchmark speeds:

  • Mann–Whitney U test with statistical test for significance of 5%
  • Only results indicating a difference greater than 10% and 0.3 ns are considered.

Allocation changes below 0.5% are ignored.

Benchmark details

Benchmarks.Trace.ActivityBenchmark - Same speed ✔️ Same allocations ✔️

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master StartStopWithChild net6.0 8.15μs 48.2ns 480ns 0.0198 0.00793 0 5.61 KB
master StartStopWithChild netcoreapp3.1 10.3μs 58.1ns 406ns 0.0154 0.00515 0 5.8 KB
master StartStopWithChild net472 16μs 45.4ns 164ns 1.03 0.289 0.0882 6.22 KB
#6698 StartStopWithChild net6.0 8.35μs 48.8ns 466ns 0.0189 0.00756 0 5.61 KB
#6698 StartStopWithChild netcoreapp3.1 10.5μs 58.3ns 355ns 0.0207 0.0103 0 5.81 KB
#6698 StartStopWithChild net472 16.1μs 37.8ns 146ns 1.06 0.334 0.111 6.21 KB
Benchmarks.Trace.AgentWriterBenchmark - Same speed ✔️ Same allocations ✔️

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master WriteAndFlushEnrichedTraces net6.0 466μs 211ns 789ns 0 0 0 2.7 KB
master WriteAndFlushEnrichedTraces netcoreapp3.1 645μs 311ns 1.21μs 0 0 0 2.7 KB
master WriteAndFlushEnrichedTraces net472 853μs 424ns 1.59μs 0.422 0 0 3.3 KB
#6698 WriteAndFlushEnrichedTraces net6.0 485μs 458ns 1.65μs 0 0 0 2.7 KB
#6698 WriteAndFlushEnrichedTraces netcoreapp3.1 656μs 263ns 983ns 0 0 0 2.7 KB
#6698 WriteAndFlushEnrichedTraces net472 840μs 480ns 1.86μs 0.419 0 0 3.3 KB
Benchmarks.Trace.AspNetCoreBenchmark - Same speed ✔️ Same allocations ✔️

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master SendRequest net6.0 130μs 485ns 1.88μs 0.198 0 0 14.47 KB
master SendRequest netcoreapp3.1 146μs 181ns 677ns 0.219 0 0 17.27 KB
master SendRequest net472 0.00237ns 0.00115ns 0.00445ns 0 0 0 0 b
#6698 SendRequest net6.0 132μs 572ns 2.22μs 0.194 0 0 14.47 KB
#6698 SendRequest netcoreapp3.1 141μs 485ns 1.88μs 0.208 0 0 17.27 KB
#6698 SendRequest net472 0.00122ns 0.000633ns 0.00245ns 0 0 0 0 b
Benchmarks.Trace.CIVisibilityProtocolWriterBenchmark - Same speed ✔️ Same allocations ✔️

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master WriteAndFlushEnrichedTraces net6.0 559μs 2.35μs 8.79μs 0.571 0 0 41.5 KB
master WriteAndFlushEnrichedTraces netcoreapp3.1 727μs 4.25μs 38.5μs 0.342 0 0 41.7 KB
master WriteAndFlushEnrichedTraces net472 872μs 4.06μs 17.2μs 8.19 2.59 0.431 53.27 KB
#6698 WriteAndFlushEnrichedTraces net6.0 558μs 3.12μs 20.7μs 0.561 0 0 41.47 KB
#6698 WriteAndFlushEnrichedTraces netcoreapp3.1 658μs 3.53μs 18.3μs 0.334 0 0 41.67 KB
#6698 WriteAndFlushEnrichedTraces net472 847μs 4.28μs 18.6μs 8.17 2.45 0.408 53.29 KB
Benchmarks.Trace.DbCommandBenchmark - Same speed ✔️ Same allocations ✔️

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master ExecuteNonQuery net6.0 1.3μs 0.825ns 3.2ns 0.0143 0 0 1.02 KB
master ExecuteNonQuery netcoreapp3.1 1.72μs 2.47ns 9.58ns 0.0139 0 0 1.02 KB
master ExecuteNonQuery net472 2.05μs 2.53ns 9.8ns 0.156 0.00102 0 987 B
#6698 ExecuteNonQuery net6.0 1.35μs 1.11ns 4.3ns 0.0142 0 0 1.02 KB
#6698 ExecuteNonQuery netcoreapp3.1 1.76μs 2.57ns 9.62ns 0.0134 0 0 1.02 KB
#6698 ExecuteNonQuery net472 2.1μs 1.3ns 4.51ns 0.156 0.00106 0 987 B
Benchmarks.Trace.ElasticsearchBenchmark - Same speed ✔️ Same allocations ✔️

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master CallElasticsearch net6.0 1.25μs 0.615ns 2.3ns 0.0137 0 0 976 B
master CallElasticsearch netcoreapp3.1 1.53μs 0.438ns 1.58ns 0.0135 0 0 976 B
master CallElasticsearch net472 2.5μs 2.35ns 9.11ns 0.158 0 0 995 B
master CallElasticsearchAsync net6.0 1.3μs 0.331ns 1.28ns 0.0136 0 0 952 B
master CallElasticsearchAsync netcoreapp3.1 1.69μs 1.07ns 4.02ns 0.0135 0 0 1.02 KB
master CallElasticsearchAsync net472 2.48μs 1.68ns 6.5ns 0.166 0 0 1.05 KB
#6698 CallElasticsearch net6.0 1.29μs 0.879ns 3.29ns 0.0136 0 0 976 B
#6698 CallElasticsearch netcoreapp3.1 1.57μs 1.06ns 4.11ns 0.0133 0 0 976 B
#6698 CallElasticsearch net472 2.43μs 0.957ns 3.58ns 0.157 0 0 995 B
#6698 CallElasticsearchAsync net6.0 1.28μs 0.552ns 2.06ns 0.0136 0 0 952 B
#6698 CallElasticsearchAsync netcoreapp3.1 1.68μs 2.38ns 9.23ns 0.0133 0 0 1.02 KB
#6698 CallElasticsearchAsync net472 2.58μs 1.6ns 6.21ns 0.166 0 0 1.05 KB
Benchmarks.Trace.GraphQLBenchmark - Slower ⚠️ Same allocations ✔️

Slower ⚠️ in #6698

Benchmark diff/base Base Median (ns) Diff Median (ns) Modality
Benchmarks.Trace.GraphQLBenchmark.ExecuteAsync‑net6.0 1.117 1,253.36 1,400.48

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master ExecuteAsync net6.0 1.25μs 0.418ns 1.51ns 0.0124 0 0 952 B
master ExecuteAsync netcoreapp3.1 1.68μs 0.758ns 2.84ns 0.0131 0 0 952 B
master ExecuteAsync net472 1.92μs 0.92ns 3.56ns 0.145 0 0 915 B
#6698 ExecuteAsync net6.0 1.4μs 1.03ns 3.98ns 0.0132 0 0 952 B
#6698 ExecuteAsync netcoreapp3.1 1.68μs 1.69ns 6.56ns 0.0126 0 0 952 B
#6698 ExecuteAsync net472 1.86μs 0.633ns 2.37ns 0.145 0 0 915 B
Benchmarks.Trace.HttpClientBenchmark - Same speed ✔️ Same allocations ✔️

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master SendAsync net6.0 4.58μs 2.9ns 11.2ns 0.0321 0 0 2.31 KB
master SendAsync netcoreapp3.1 5.22μs 1.99ns 7.7ns 0.0366 0 0 2.85 KB
master SendAsync net472 7.39μs 2.29ns 8.86ns 0.494 0 0 3.12 KB
#6698 SendAsync net6.0 4.3μs 1.97ns 7.36ns 0.0323 0 0 2.31 KB
#6698 SendAsync netcoreapp3.1 5.26μs 2.92ns 11.3ns 0.0394 0 0 2.85 KB
#6698 SendAsync net472 7.49μs 1.94ns 7.26ns 0.493 0 0 3.12 KB
Benchmarks.Trace.ILoggerBenchmark - Same speed ✔️ Same allocations ✔️

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master EnrichedLog net6.0 1.66μs 1.25ns 4.67ns 0.0229 0 0 1.64 KB
master EnrichedLog netcoreapp3.1 2.18μs 0.612ns 2.37ns 0.0218 0 0 1.64 KB
master EnrichedLog net472 2.5μs 1.22ns 4.57ns 0.249 0 0 1.57 KB
#6698 EnrichedLog net6.0 1.66μs 0.665ns 2.4ns 0.0233 0 0 1.64 KB
#6698 EnrichedLog netcoreapp3.1 2.16μs 1.42ns 5.49ns 0.0218 0 0 1.64 KB
#6698 EnrichedLog net472 2.62μs 0.816ns 2.94ns 0.249 0 0 1.57 KB
Benchmarks.Trace.Log4netBenchmark - Same speed ✔️ Same allocations ✔️

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master EnrichedLog net6.0 113μs 98.3ns 368ns 0.0566 0 0 4.28 KB
master EnrichedLog netcoreapp3.1 116μs 152ns 589ns 0.0579 0 0 4.28 KB
master EnrichedLog net472 151μs 192ns 742ns 0.676 0.225 0 4.46 KB
#6698 EnrichedLog net6.0 114μs 363ns 1.41μs 0.0567 0 0 4.28 KB
#6698 EnrichedLog netcoreapp3.1 117μs 205ns 794ns 0.0582 0 0 4.28 KB
#6698 EnrichedLog net472 150μs 154ns 598ns 0.672 0.224 0 4.46 KB
Benchmarks.Trace.NLogBenchmark - Same speed ✔️ Same allocations ✔️

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master EnrichedLog net6.0 2.98μs 1.13ns 4.37ns 0.0299 0 0 2.2 KB
master EnrichedLog netcoreapp3.1 4.06μs 0.794ns 3.08ns 0.0285 0 0 2.2 KB
master EnrichedLog net472 4.79μs 1.34ns 5.18ns 0.32 0 0 2.02 KB
#6698 EnrichedLog net6.0 3.03μs 0.937ns 3.63ns 0.0303 0 0 2.2 KB
#6698 EnrichedLog netcoreapp3.1 4.09μs 1.39ns 5.2ns 0.0306 0 0 2.2 KB
#6698 EnrichedLog net472 4.99μs 1.94ns 7.52ns 0.32 0 0 2.02 KB
Benchmarks.Trace.RedisBenchmark - Same speed ✔️ Same allocations ✔️

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master SendReceive net6.0 1.52μs 0.758ns 2.94ns 0.016 0 0 1.14 KB
master SendReceive netcoreapp3.1 1.74μs 0.539ns 1.87ns 0.0157 0 0 1.14 KB
master SendReceive net472 2.05μs 0.814ns 3.15ns 0.183 0 0 1.16 KB
#6698 SendReceive net6.0 1.51μs 0.584ns 2.26ns 0.0159 0 0 1.14 KB
#6698 SendReceive netcoreapp3.1 1.79μs 1.51ns 5.85ns 0.0152 0 0 1.14 KB
#6698 SendReceive net472 2.08μs 0.966ns 3.74ns 0.184 0 0 1.16 KB
Benchmarks.Trace.SerilogBenchmark - Same speed ✔️ Same allocations ✔️

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master EnrichedLog net6.0 2.82μs 1.6ns 6.18ns 0.0226 0 0 1.6 KB
master EnrichedLog netcoreapp3.1 3.85μs 1.41ns 5.47ns 0.0212 0 0 1.65 KB
master EnrichedLog net472 4.27μs 4.02ns 15.6ns 0.323 0 0 2.04 KB
#6698 EnrichedLog net6.0 2.91μs 0.998ns 3.87ns 0.0218 0 0 1.6 KB
#6698 EnrichedLog netcoreapp3.1 4.06μs 1.68ns 6.28ns 0.0225 0 0 1.65 KB
#6698 EnrichedLog net472 4.19μs 3.89ns 15.1ns 0.322 0 0 2.04 KB
Benchmarks.Trace.SpanBenchmark - Slower ⚠️ Same allocations ✔️

Slower ⚠️ in #6698

Benchmark diff/base Base Median (ns) Diff Median (ns) Modality
Benchmarks.Trace.SpanBenchmark.StartFinishSpan‑net6.0 1.166 388.99 453.60

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master StartFinishSpan net6.0 389ns 0.594ns 2.3ns 0.00805 0 0 576 B
master StartFinishSpan netcoreapp3.1 584ns 1.31ns 5.07ns 0.00778 0 0 576 B
master StartFinishSpan net472 615ns 1.6ns 6.21ns 0.0918 0 0 578 B
master StartFinishScope net6.0 486ns 0.582ns 2.18ns 0.00967 0 0 696 B
master StartFinishScope netcoreapp3.1 791ns 1.76ns 6.83ns 0.00941 0 0 696 B
master StartFinishScope net472 793ns 2.47ns 9.55ns 0.104 0 0 658 B
#6698 StartFinishSpan net6.0 454ns 0.159ns 0.616ns 0.00805 0 0 576 B
#6698 StartFinishSpan netcoreapp3.1 559ns 0.246ns 0.952ns 0.0079 0 0 576 B
#6698 StartFinishSpan net472 677ns 0.439ns 1.64ns 0.0916 0 0 578 B
#6698 StartFinishScope net6.0 494ns 0.23ns 0.889ns 0.00972 0 0 696 B
#6698 StartFinishScope netcoreapp3.1 719ns 0.367ns 1.42ns 0.00933 0 0 696 B
#6698 StartFinishScope net472 801ns 0.772ns 2.99ns 0.104 0 0 658 B
Benchmarks.Trace.TraceAnnotationsBenchmark - Slower ⚠️ Same allocations ✔️

Slower ⚠️ in #6698

Benchmark diff/base Base Median (ns) Diff Median (ns) Modality
Benchmarks.Trace.TraceAnnotationsBenchmark.RunOnMethodBegin‑net6.0 1.171 622.24 728.45
Benchmarks.Trace.TraceAnnotationsBenchmark.RunOnMethodBegin‑net472 1.170 991.67 1,160.34
Benchmarks.Trace.TraceAnnotationsBenchmark.RunOnMethodBegin‑netcoreapp3.1 1.150 833.37 958.13

Raw results

Branch Method Toolchain Mean StdError StdDev Gen 0 Gen 1 Gen 2 Allocated
master RunOnMethodBegin net6.0 621ns 0.952ns 3.69ns 0.00983 0 0 696 B
master RunOnMethodBegin netcoreapp3.1 835ns 1.49ns 5.77ns 0.00922 0 0 696 B
master RunOnMethodBegin net472 996ns 2.28ns 8.82ns 0.104 0 0 658 B
#6698 RunOnMethodBegin net6.0 728ns 0.7ns 2.71ns 0.00985 0 0 696 B
#6698 RunOnMethodBegin netcoreapp3.1 959ns 0.934ns 3.62ns 0.00969 0 0 696 B
#6698 RunOnMethodBegin net472 1.16μs 0.867ns 3.36ns 0.104 0 0 658 B

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:ssi type:enhancement Improvement to an existing feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants