Skip to content

Commit 4ea0043

Browse files
[main] Update dependencies from dotnet/efcore, dotnet/runtime (#56848)
[main] Update dependencies from dotnet/efcore, dotnet/runtime - Revert ResponseCompressionMiddleware changes from previous runtime update - Update expected gzip size - Update project.csproj.template - update to final API approved and merged into runtime - extract the API pieces that are now in runtime - work around ToDistributedCacheEntryOptions memoize utility method - add back missing APIs incorrectly deleted - fixup csproj - no longer need framework backref - Add missing reference in Microsoft.Extensions.Caching.MicroBenchmarks.csproj - compression - Account for fingerprinted assemblies - Suppress new illink warning
1 parent 98ee502 commit 4ea0043

23 files changed

+337
-646
lines changed

eng/Version.Details.xml

Lines changed: 160 additions & 160 deletions
Large diffs are not rendered by default.

eng/Versions.props

Lines changed: 80 additions & 80 deletions
Large diffs are not rendered by default.

eng/testing/linker/project.csproj.template

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
<MicrosoftNETCoreAppRuntimeVersion>{MicrosoftNETCoreAppRuntimeVersion}</MicrosoftNETCoreAppRuntimeVersion>
99
<MicrosoftNETCoreAppRefVersion>{MicrosoftNETCoreAppRefVersion}</MicrosoftNETCoreAppRefVersion>
1010
<RepoRoot>{RepoRoot}</RepoRoot>
11+
<!-- This warning code is no longer generated by new ILLinker, but the repo still uses the old ILLinker so we need to suppress temporarily -->
12+
<NoWarn>$(NoWarn);IL2119</NoWarn>
1113
<!-- Workaround while there is no SDK available that understands the TFM; suppress unsupported version errors. -->
1214
<NETCoreAppMaximumVersion>99.9</NETCoreAppMaximumVersion>
1315
<_ExtraTrimmerArgs>{ExtraTrimmerArgs} $(_ExtraTrimmerArgs)</_ExtraTrimmerArgs>

src/Caching/Hybrid/src/Internal/DefaultHybridCache.L2.cs

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,9 +106,19 @@ private DistributedCacheEntryOptions GetOptions(HybridCacheEntryOptions? options
106106
DistributedCacheEntryOptions? result = null;
107107
if (options is not null && options.Expiration.HasValue && options.Expiration.GetValueOrDefault() != _defaultExpiration)
108108
{
109-
result = options.ToDistributedCacheEntryOptions();
109+
result = ToDistributedCacheEntryOptions(options);
110110
}
111111
return result ?? _defaultDistributedCacheExpiration;
112+
113+
#if NET8_0_OR_GREATER
114+
// internal method memoizes this allocation; since it is "init", it is immutable (outside reflection)
115+
[UnsafeAccessor(UnsafeAccessorKind.Method, Name = nameof(ToDistributedCacheEntryOptions))]
116+
extern static DistributedCacheEntryOptions? ToDistributedCacheEntryOptions(HybridCacheEntryOptions options);
117+
#else
118+
// withoug that helper method, we'll just eat the alloc (down-level TFMs)
119+
static DistributedCacheEntryOptions ToDistributedCacheEntryOptions(HybridCacheEntryOptions options)
120+
=> new() { AbsoluteExpirationRelativeToNow = options.Expiration };
121+
#endif
112122
}
113123

114124
internal void SetL1<T>(string key, CacheItem<T> value, HybridCacheEntryOptions? options)

src/Caching/Hybrid/src/Internal/DefaultHybridCache.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -108,12 +108,12 @@ public DefaultHybridCache(IOptions<HybridCacheOptions> options, IServiceProvider
108108
private HybridCacheEntryFlags GetEffectiveFlags(HybridCacheEntryOptions? options)
109109
=> (options?.Flags | _hardFlags) ?? _defaultFlags;
110110

111-
public override ValueTask<T> GetOrCreateAsync<TState, T>(string key, TState state, Func<TState, CancellationToken, ValueTask<T>> underlyingDataCallback, HybridCacheEntryOptions? options = null, IReadOnlyCollection<string>? tags = null, CancellationToken token = default)
111+
public override ValueTask<T> GetOrCreateAsync<TState, T>(string key, TState state, Func<TState, CancellationToken, ValueTask<T>> underlyingDataCallback, HybridCacheEntryOptions? options = null, IEnumerable<string>? tags = null, CancellationToken cancellationToken = default)
112112
{
113-
var canBeCanceled = token.CanBeCanceled;
113+
var canBeCanceled = cancellationToken.CanBeCanceled;
114114
if (canBeCanceled)
115115
{
116-
token.ThrowIfCancellationRequested();
116+
cancellationToken.ThrowIfCancellationRequested();
117117
}
118118

119119
var flags = GetEffectiveFlags(options);
@@ -141,7 +141,7 @@ public override ValueTask<T> GetOrCreateAsync<TState, T>(string key, TState stat
141141
}
142142
}
143143

144-
return stampede.JoinAsync(token);
144+
return stampede.JoinAsync(cancellationToken);
145145
}
146146

147147
public override ValueTask RemoveAsync(string key, CancellationToken token = default)
@@ -153,7 +153,7 @@ public override ValueTask RemoveAsync(string key, CancellationToken token = defa
153153
public override ValueTask RemoveByTagAsync(string tag, CancellationToken token = default)
154154
=> default; // tags not yet implemented
155155

156-
public override ValueTask SetAsync<T>(string key, T value, HybridCacheEntryOptions? options = null, IReadOnlyCollection<string>? tags = null, CancellationToken token = default)
156+
public override ValueTask SetAsync<T>(string key, T value, HybridCacheEntryOptions? options = null, IEnumerable<string>? tags = null, CancellationToken token = default)
157157
{
158158
// since we're forcing a write: disable L1+L2 read; we'll use a direct pass-thru of the value as the callback, to reuse all the code;
159159
// note also that stampede token is not shared with anyone else
Lines changed: 0 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,4 @@
11
#nullable enable
2-
abstract Microsoft.Extensions.Caching.Hybrid.HybridCache.GetOrCreateAsync<TState, T>(string! key, TState state, System.Func<TState, System.Threading.CancellationToken, System.Threading.Tasks.ValueTask<T>>! factory, Microsoft.Extensions.Caching.Hybrid.HybridCacheEntryOptions? options = null, System.Collections.Generic.IReadOnlyCollection<string!>? tags = null, System.Threading.CancellationToken token = default(System.Threading.CancellationToken)) -> System.Threading.Tasks.ValueTask<T>
3-
abstract Microsoft.Extensions.Caching.Hybrid.HybridCache.RemoveAsync(string! key, System.Threading.CancellationToken token = default(System.Threading.CancellationToken)) -> System.Threading.Tasks.ValueTask
4-
abstract Microsoft.Extensions.Caching.Hybrid.HybridCache.RemoveByTagAsync(string! tag, System.Threading.CancellationToken token = default(System.Threading.CancellationToken)) -> System.Threading.Tasks.ValueTask
5-
abstract Microsoft.Extensions.Caching.Hybrid.HybridCache.SetAsync<T>(string! key, T value, Microsoft.Extensions.Caching.Hybrid.HybridCacheEntryOptions? options = null, System.Collections.Generic.IReadOnlyCollection<string!>? tags = null, System.Threading.CancellationToken token = default(System.Threading.CancellationToken)) -> System.Threading.Tasks.ValueTask
6-
Microsoft.Extensions.Caching.Distributed.IBufferDistributedCache
7-
Microsoft.Extensions.Caching.Distributed.IBufferDistributedCache.Set(string! key, System.Buffers.ReadOnlySequence<byte> value, Microsoft.Extensions.Caching.Distributed.DistributedCacheEntryOptions! options) -> void
8-
Microsoft.Extensions.Caching.Distributed.IBufferDistributedCache.SetAsync(string! key, System.Buffers.ReadOnlySequence<byte> value, Microsoft.Extensions.Caching.Distributed.DistributedCacheEntryOptions! options, System.Threading.CancellationToken token = default(System.Threading.CancellationToken)) -> System.Threading.Tasks.ValueTask
9-
Microsoft.Extensions.Caching.Distributed.IBufferDistributedCache.TryGet(string! key, System.Buffers.IBufferWriter<byte>! destination) -> bool
10-
Microsoft.Extensions.Caching.Distributed.IBufferDistributedCache.TryGetAsync(string! key, System.Buffers.IBufferWriter<byte>! destination, System.Threading.CancellationToken token = default(System.Threading.CancellationToken)) -> System.Threading.Tasks.ValueTask<bool>
11-
Microsoft.Extensions.Caching.Hybrid.HybridCache
12-
Microsoft.Extensions.Caching.Hybrid.HybridCache.GetOrCreateAsync<T>(string! key, System.Func<System.Threading.CancellationToken, System.Threading.Tasks.ValueTask<T>>! factory, Microsoft.Extensions.Caching.Hybrid.HybridCacheEntryOptions? options = null, System.Collections.Generic.IReadOnlyCollection<string!>? tags = null, System.Threading.CancellationToken token = default(System.Threading.CancellationToken)) -> System.Threading.Tasks.ValueTask<T>
13-
Microsoft.Extensions.Caching.Hybrid.HybridCache.HybridCache() -> void
14-
Microsoft.Extensions.Caching.Hybrid.HybridCacheEntryFlags
15-
Microsoft.Extensions.Caching.Hybrid.HybridCacheEntryFlags.DisableCompression = 32 -> Microsoft.Extensions.Caching.Hybrid.HybridCacheEntryFlags
16-
Microsoft.Extensions.Caching.Hybrid.HybridCacheEntryFlags.DisableDistributedCache = Microsoft.Extensions.Caching.Hybrid.HybridCacheEntryFlags.DisableDistributedCacheRead | Microsoft.Extensions.Caching.Hybrid.HybridCacheEntryFlags.DisableDistributedCacheWrite -> Microsoft.Extensions.Caching.Hybrid.HybridCacheEntryFlags
17-
Microsoft.Extensions.Caching.Hybrid.HybridCacheEntryFlags.DisableDistributedCacheRead = 4 -> Microsoft.Extensions.Caching.Hybrid.HybridCacheEntryFlags
18-
Microsoft.Extensions.Caching.Hybrid.HybridCacheEntryFlags.DisableDistributedCacheWrite = 8 -> Microsoft.Extensions.Caching.Hybrid.HybridCacheEntryFlags
19-
Microsoft.Extensions.Caching.Hybrid.HybridCacheEntryFlags.DisableLocalCache = Microsoft.Extensions.Caching.Hybrid.HybridCacheEntryFlags.DisableLocalCacheRead | Microsoft.Extensions.Caching.Hybrid.HybridCacheEntryFlags.DisableLocalCacheWrite -> Microsoft.Extensions.Caching.Hybrid.HybridCacheEntryFlags
20-
Microsoft.Extensions.Caching.Hybrid.HybridCacheEntryFlags.DisableLocalCacheRead = 1 -> Microsoft.Extensions.Caching.Hybrid.HybridCacheEntryFlags
21-
Microsoft.Extensions.Caching.Hybrid.HybridCacheEntryFlags.DisableLocalCacheWrite = 2 -> Microsoft.Extensions.Caching.Hybrid.HybridCacheEntryFlags
22-
Microsoft.Extensions.Caching.Hybrid.HybridCacheEntryFlags.DisableUnderlyingData = 16 -> Microsoft.Extensions.Caching.Hybrid.HybridCacheEntryFlags
23-
Microsoft.Extensions.Caching.Hybrid.HybridCacheEntryFlags.None = 0 -> Microsoft.Extensions.Caching.Hybrid.HybridCacheEntryFlags
24-
Microsoft.Extensions.Caching.Hybrid.HybridCacheEntryOptions
25-
Microsoft.Extensions.Caching.Hybrid.HybridCacheEntryOptions.Expiration.get -> System.TimeSpan?
26-
Microsoft.Extensions.Caching.Hybrid.HybridCacheEntryOptions.Expiration.init -> void
27-
Microsoft.Extensions.Caching.Hybrid.HybridCacheEntryOptions.Flags.get -> Microsoft.Extensions.Caching.Hybrid.HybridCacheEntryFlags?
28-
Microsoft.Extensions.Caching.Hybrid.HybridCacheEntryOptions.Flags.init -> void
29-
Microsoft.Extensions.Caching.Hybrid.HybridCacheEntryOptions.HybridCacheEntryOptions() -> void
30-
Microsoft.Extensions.Caching.Hybrid.HybridCacheEntryOptions.LocalCacheExpiration.get -> System.TimeSpan?
31-
Microsoft.Extensions.Caching.Hybrid.HybridCacheEntryOptions.LocalCacheExpiration.init -> void
322
Microsoft.Extensions.Caching.Hybrid.HybridCacheOptions
333
Microsoft.Extensions.Caching.Hybrid.HybridCacheOptions.DefaultEntryOptions.get -> Microsoft.Extensions.Caching.Hybrid.HybridCacheEntryOptions?
344
Microsoft.Extensions.Caching.Hybrid.HybridCacheOptions.DefaultEntryOptions.set -> void
@@ -43,11 +13,6 @@ Microsoft.Extensions.Caching.Hybrid.HybridCacheOptions.ReportTagMetrics.get -> b
4313
Microsoft.Extensions.Caching.Hybrid.HybridCacheOptions.ReportTagMetrics.set -> void
4414
Microsoft.Extensions.Caching.Hybrid.IHybridCacheBuilder
4515
Microsoft.Extensions.Caching.Hybrid.IHybridCacheBuilder.Services.get -> Microsoft.Extensions.DependencyInjection.IServiceCollection!
46-
Microsoft.Extensions.Caching.Hybrid.IHybridCacheSerializer<T>
47-
Microsoft.Extensions.Caching.Hybrid.IHybridCacheSerializer<T>.Deserialize(System.Buffers.ReadOnlySequence<byte> source) -> T
48-
Microsoft.Extensions.Caching.Hybrid.IHybridCacheSerializer<T>.Serialize(T value, System.Buffers.IBufferWriter<byte>! target) -> void
49-
Microsoft.Extensions.Caching.Hybrid.IHybridCacheSerializerFactory
50-
Microsoft.Extensions.Caching.Hybrid.IHybridCacheSerializerFactory.TryCreateSerializer<T>(out Microsoft.Extensions.Caching.Hybrid.IHybridCacheSerializer<T>? serializer) -> bool
5116
Microsoft.Extensions.DependencyInjection.HybridCacheBuilderExtensions
5217
Microsoft.Extensions.DependencyInjection.HybridCacheServiceExtensions
5318
static Microsoft.Extensions.DependencyInjection.HybridCacheBuilderExtensions.AddSerializer<T, TImplementation>(this Microsoft.Extensions.Caching.Hybrid.IHybridCacheBuilder! builder) -> Microsoft.Extensions.Caching.Hybrid.IHybridCacheBuilder!
@@ -56,5 +21,3 @@ static Microsoft.Extensions.DependencyInjection.HybridCacheBuilderExtensions.Add
5621
static Microsoft.Extensions.DependencyInjection.HybridCacheBuilderExtensions.AddSerializerFactory<TImplementation>(this Microsoft.Extensions.Caching.Hybrid.IHybridCacheBuilder! builder) -> Microsoft.Extensions.Caching.Hybrid.IHybridCacheBuilder!
5722
static Microsoft.Extensions.DependencyInjection.HybridCacheServiceExtensions.AddHybridCache(this Microsoft.Extensions.DependencyInjection.IServiceCollection! services) -> Microsoft.Extensions.Caching.Hybrid.IHybridCacheBuilder!
5823
static Microsoft.Extensions.DependencyInjection.HybridCacheServiceExtensions.AddHybridCache(this Microsoft.Extensions.DependencyInjection.IServiceCollection! services, System.Action<Microsoft.Extensions.Caching.Hybrid.HybridCacheOptions!>! setupAction) -> Microsoft.Extensions.Caching.Hybrid.IHybridCacheBuilder!
59-
virtual Microsoft.Extensions.Caching.Hybrid.HybridCache.RemoveAsync(System.Collections.Generic.IEnumerable<string!>! keys, System.Threading.CancellationToken token = default(System.Threading.CancellationToken)) -> System.Threading.Tasks.ValueTask
60-
virtual Microsoft.Extensions.Caching.Hybrid.HybridCache.RemoveByTagAsync(System.Collections.Generic.IEnumerable<string!>! tags, System.Threading.CancellationToken token = default(System.Threading.CancellationToken)) -> System.Threading.Tasks.ValueTask

0 commit comments

Comments
 (0)