mirror of
https://github.com/OPCFoundation/UA-.NETStandard.git
synced 2026-10-22 09:37:12 +08:00
9b034f8291
# Description Nullable reference types are now enabled once, in `common.props`, and every project in the repository builds warning-clean with them. **Configuration** - `<Nullable>enable</Nullable>` lives in `common.props`. All per-project `<Nullable>` settings are removed: 178 project files (enable, annotations, and the `disable` in the three Aot test projects). - 419 per-file `#nullable enable`/`restore` directives and the 4 `#nullable disable` directives are removed. - Kept on purpose: - The 5 `<auto-generated>` schema files (`UANodeSet.cs`, `UA Type Dictionary.cs`, `OPCBinarySchema.cs`, `SecuredApplication.cs`, `PInvokeHelper.cs`) keep `#nullable enable`. The compiler ignores the project setting in generated code, so the directive is required there. - `tests/Opc.Ua.Interop.LegacyPeer` keeps `disable`. It builds against the 1.5.378 packages and does not import the repository props. - `docs/DeveloperGuide.md` and `.github/copilot-instructions.md` now describe the central setting. **Migration** (the 43 unset and 13 annotations-only projects, roughly 10k diagnostics) - **Production code: annotated at the declarations.** Covers `tools/Opc.Ua.SourceGeneration.Core`, `src/Opc.Ua.Lds.Server` and the LDS sample. - Members, parameters and returns are nullable where null actually flows. - Null-check helpers carry `[NotNullWhen]` (`IsNull`, `IsValidXmlName`, `IsMethodTypeDesign`). - `CoreUtils.Format`, `Utils.Format`, `ITemplateWriter.WriteLine` take `params object?[]`. `Template.AddReplacement` takes `string?` (rendering already skips null replacements). - `IRegisteredServerStore.RegisterAsync` returns `Task<RegistrationEntry?>`: it returns null when a registration is removed. - Dereferences backed by an invariant (for example, the validated model) use `!`, so runtime behaviour is unchanged. - **Behavioural changes in production code** (small, deliberate): - `NodeSetToModelDesign` throws `InvalidOperationException` when the file is not a NodeSet. Before, it threw a NullReferenceException on the next line. - `ModelDesignValidator` starts its lookup tables empty instead of null. A redundant `if (m_nodes == null) return;` guard is gone. - **Test code: minimal annotations.** - `?` on values that can be null, `!` where the test asserts non-null. - `= null!` for fixture members assigned in SetUp. - `TryGetStructure<T>(out T? x)` where the inferred `T?` broke the `IEncodeable` constraint. - A few redundant `== null` checks on structs (`NodeId`, `ArrayOf<T>`) folded into the adjacent `IsNull`/`Count` checks. **Notes for reviewers** - The diff is large (~1,500 files) but almost entirely mechanical: `?`, `!` and directive removal. The non-annotation changes are listed above. - Known follow-up, not done here: `IModelDesign.Namespaces/TargetNamespace/NamespaceUris` stay non-nullable even though the validator returns null before it loads a dictionary. Making them nullable would ripple through every generator call site. ## Related Issues - Fixes #4439 ## Checklist - [ ] I have signed the [CLA](https://opcfoundation.org/license/cla/ContributorLicenseAgreementv1.0.pdf) and read the [CONTRIBUTING](https://github.com/OPCFoundation/UA-.NETStandard/blob/master/CONTRIBUTING.md) doc. - [ ] I have added tests that prove my fix is effective or that my feature works and increased code coverage. - [x] I have added all necessary documentation. - [x] I have verified that my changes do not introduce (new) build or analyzer warnings. - [ ] I ran **all** tests locally using the **UA.slnx** solution against at least .net **framework** and .net **10**, and all passed. - [ ] I fixed **all** failing and flaky tests in the CI pipelines and **all** CodeQL warnings. - [ ] I have addressed **all** PR feedback received. The "no new warnings" box covers net10.0 and net48: full non-incremental builds of `UA.slnx`, `tools/SourceGeneration.slnx`, `tools/MigrationAnalyzer.slnx` and the Aot test projects finished with 0 warnings and 0 errors under the repository's warnings-as-errors settings. net9.0 and net8.0 also had no nullable diagnostics, but they were not rebuilt after the final fixes. Tests have not been run locally yet. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
460 lines
19 KiB
C#
460 lines
19 KiB
C#
/* ========================================================================
|
|
* Copyright (c) 2005-2025 The OPC Foundation, Inc. All rights reserved.
|
|
*
|
|
* OPC Foundation MIT License 1.00
|
|
*
|
|
* Permission is hereby granted, free of charge, to any person
|
|
* obtaining a copy of this software and associated documentation
|
|
* files (the "Software"), to deal in the Software without
|
|
* restriction, including without limitation the rights to use,
|
|
* copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
* copies of the Software, and to permit persons to whom the
|
|
* Software is furnished to do so, subject to the following
|
|
* conditions:
|
|
*
|
|
* The above copyright notice and this permission notice shall be
|
|
* included in all copies or substantial portions of the Software.
|
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
|
|
* OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
|
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
|
|
* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
|
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
|
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
|
* OTHER DEALINGS IN THE SOFTWARE.
|
|
*
|
|
* The complete license agreement can be found here:
|
|
* http://opcfoundation.org/License/MIT/1.00/
|
|
* ======================================================================*/
|
|
|
|
// CA2000: test code; many disposables are ownership-transferred to test fixtures or short-lived,
|
|
// making CA2000 noisy without a real leak risk. Disabled file-level for the suite.
|
|
#pragma warning disable CA2000
|
|
using System;
|
|
using System.Reflection;
|
|
using System.Threading;
|
|
using System.Threading.Tasks;
|
|
using Moq;
|
|
using NUnit.Framework;
|
|
using Opc.Ua.Tests;
|
|
|
|
namespace Opc.Ua.Core.Tests.Stack.Server
|
|
{
|
|
/// <summary>
|
|
/// Verifies worker sizing, request completion and parked-request dispatch.
|
|
/// </summary>
|
|
[TestFixture]
|
|
[Category("Server")]
|
|
[SetCulture("en-us")]
|
|
[SetUICulture("en-us")]
|
|
[Parallelizable]
|
|
public class RequestQueueTests
|
|
{
|
|
private sealed class TestEndpointIncomingRequest : IEndpointIncomingRequest
|
|
{
|
|
public TaskCompletionSource<bool> ProcessingStarted { get; } = new TaskCompletionSource<bool>();
|
|
public TaskCompletionSource<bool> ProcessingCompleted { get; } = new TaskCompletionSource<bool>();
|
|
public StatusCode? CompletedStatusCode { get; private set; }
|
|
|
|
public IServiceRequest Request => null!;
|
|
|
|
public SecureChannelContext SecureChannelContext => null!;
|
|
|
|
public ValueTask CallAsync(CancellationToken cancellationToken = default)
|
|
{
|
|
ProcessingStarted.TrySetResult(true);
|
|
return new ValueTask(ProcessingCompleted.Task);
|
|
}
|
|
|
|
public void OperationCompleted(IServiceResponse? response, ServiceResult error)
|
|
{
|
|
CompletedStatusCode = error?.StatusCode;
|
|
ProcessingCompleted.TrySetResult(true);
|
|
}
|
|
}
|
|
|
|
private sealed class ParkableTestRequest : IParkableIncomingRequest
|
|
{
|
|
public TaskCompletionSource<bool> ProcessingStarted { get; } = new TaskCompletionSource<bool>();
|
|
public TaskCompletionSource<bool> ProcessingCompleted { get; } = new TaskCompletionSource<bool>();
|
|
public StatusCode? CompletedStatusCode { get; private set; }
|
|
|
|
public IServiceRequest Request => null!;
|
|
|
|
public SecureChannelContext SecureChannelContext => null!;
|
|
|
|
RequestParkSink IParkableIncomingRequest.ParkSink => m_parkSink;
|
|
|
|
public ValueTask CallAsync(CancellationToken cancellationToken = default)
|
|
{
|
|
ProcessingStarted.TrySetResult(true);
|
|
|
|
// Simulate reaching the park point (queued waiting for a notification):
|
|
// the worker should be released even though processing has not completed.
|
|
m_parkSink.NotifyParked();
|
|
return new ValueTask(ProcessingCompleted.Task);
|
|
}
|
|
|
|
public void OperationCompleted(IServiceResponse? response, ServiceResult error)
|
|
{
|
|
CompletedStatusCode = error?.StatusCode;
|
|
ProcessingCompleted.TrySetResult(true);
|
|
}
|
|
|
|
private readonly RequestParkSink m_parkSink = new();
|
|
}
|
|
|
|
/// <summary>
|
|
/// Hosts configurable production request queues and controllable test handlers.
|
|
/// </summary>
|
|
private sealed class TestServer : ServerBase
|
|
{
|
|
public TestServer()
|
|
: base(NUnitTelemetryContext.Create(true))
|
|
{
|
|
}
|
|
|
|
/// <summary>
|
|
/// Gets the actual number of retained queue workers, including idle workers.
|
|
/// </summary>
|
|
public int WorkerCount
|
|
{
|
|
get
|
|
{
|
|
FieldInfo queueField = typeof(ServerBase).GetField(
|
|
"m_requestQueue", BindingFlags.NonPublic | BindingFlags.Instance)!;
|
|
var queue = (RequestQueue)queueField!.GetValue(this)!;
|
|
FieldInfo countField = typeof(RequestQueue).GetField(
|
|
"m_totalThreadCount", BindingFlags.NonPublic | BindingFlags.Instance)!;
|
|
return (int)countField!.GetValue(queue)!;
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// Replaces the default queue with the requested worker and admission envelope.
|
|
/// </summary>
|
|
public void ReplaceRequestQueue(
|
|
int minThreads,
|
|
int maxThreads,
|
|
int maxQueue,
|
|
bool decoupleHeldPublishRequests = true,
|
|
IServerResourceIsolationProvider? provider = null)
|
|
{
|
|
FieldInfo field = typeof(ServerBase).GetField(
|
|
"m_requestQueue",
|
|
BindingFlags.NonPublic | BindingFlags.Instance)!;
|
|
|
|
var oldQueue = field!.GetValue(this) as IDisposable;
|
|
oldQueue?.Dispose();
|
|
|
|
var newQueue = new RequestQueue(
|
|
this, minThreads, maxThreads, maxQueue, decoupleHeldPublishRequests, provider, 10);
|
|
field.SetValue(this, newQueue);
|
|
}
|
|
|
|
/// <summary>
|
|
/// Fair scheduling does not reserve the maximum worker envelope before demand exists.
|
|
/// </summary>
|
|
[Test]
|
|
public void FairQueueStartsOnlyItsMinimumWorkers()
|
|
{
|
|
var provider = new Mock<IServerResourceIsolationProvider>();
|
|
provider.SetupGet(value => value.UseFairScheduling).Returns(true);
|
|
using var server = new TestServer();
|
|
server.ReplaceRequestQueue(2, 16, 100, provider: provider.Object);
|
|
Assert.That(server.WorkerCount, Is.EqualTo(2));
|
|
}
|
|
|
|
protected override Task ProcessRequestAsync(IEndpointIncomingRequest request, CancellationToken cancellationToken = default)
|
|
{
|
|
return request.CallAsync(cancellationToken).AsTask();
|
|
}
|
|
}
|
|
|
|
[Test]
|
|
public async Task TestRequestProcessingAsync()
|
|
{
|
|
using var server = new TestServer();
|
|
server.ReplaceRequestQueue(2, 4, 10);
|
|
|
|
var request1 = new TestEndpointIncomingRequest();
|
|
server.ScheduleIncomingRequest(request1);
|
|
|
|
using var cts = new CancellationTokenSource(5000);
|
|
Task<bool> t1 = request1.ProcessingStarted.Task;
|
|
if (await Task.WhenAny(t1, Task.Delay(5000, cts.Token)).ConfigureAwait(false) != t1)
|
|
{
|
|
Assert.Fail("Timed out waiting for processing to start.");
|
|
}
|
|
|
|
request1.ProcessingCompleted.SetResult(true);
|
|
Assert.That(request1.CompletedStatusCode, Is.Null, "Request should not have an error status.");
|
|
}
|
|
|
|
[Test]
|
|
public async Task TestTooManyRequestsAsync()
|
|
{
|
|
using var server = new TestServer();
|
|
server.ReplaceRequestQueue(1, 1, 1);
|
|
|
|
var req1 = new TestEndpointIncomingRequest();
|
|
var req2 = new TestEndpointIncomingRequest();
|
|
var req3 = new TestEndpointIncomingRequest();
|
|
|
|
server.ScheduleIncomingRequest(req1);
|
|
|
|
// Wait for req1 to start processing so it leaves the queue.
|
|
Task<bool> t1 = req1.ProcessingStarted.Task;
|
|
using (var cts1 = new CancellationTokenSource(5000))
|
|
{
|
|
if (await Task.WhenAny(t1, Task.Delay(5000, cts1.Token)).ConfigureAwait(false) != t1)
|
|
{
|
|
Assert.Fail("Timed out waiting for processing to start.");
|
|
}
|
|
}
|
|
|
|
// req1 is active (taking the 1 thread), queue is now empty. Capacity is 1.
|
|
server.ScheduleIncomingRequest(req2); // Goes to queue.
|
|
server.ScheduleIncomingRequest(req3); // Should fail to enter queue.
|
|
|
|
// req3 should be rejected synchronously or near-synchronously; wait briefly.
|
|
using (var cts3 = new CancellationTokenSource(5000))
|
|
{
|
|
await Task.WhenAny(req3.ProcessingCompleted.Task, Task.Delay(5000, cts3.Token))
|
|
.ConfigureAwait(false);
|
|
}
|
|
|
|
Assert.That(req3.CompletedStatusCode, Is.EqualTo(StatusCodes.BadServerTooBusy));
|
|
|
|
req1.ProcessingCompleted.TrySetResult(true);
|
|
|
|
Task<bool> t2 = req2.ProcessingStarted.Task;
|
|
using (var cts2 = new CancellationTokenSource(5000))
|
|
{
|
|
if (await Task.WhenAny(t2, Task.Delay(5000, cts2.Token)).ConfigureAwait(false) != t2)
|
|
{
|
|
Assert.Fail("Timed out waiting for req2 processing to start.");
|
|
}
|
|
}
|
|
|
|
req2.ProcessingCompleted.TrySetResult(true);
|
|
req3.ProcessingCompleted.TrySetResult(true);
|
|
}
|
|
|
|
[Test]
|
|
public async Task TestHighLoadAsync()
|
|
{
|
|
using var server = new TestServer();
|
|
server.ReplaceRequestQueue(4, 10, 1000);
|
|
|
|
const int count = 500;
|
|
var requests = new TestEndpointIncomingRequest[count];
|
|
|
|
for (int i = 0; i < count; i++)
|
|
{
|
|
requests[i] = new TestEndpointIncomingRequest();
|
|
|
|
// Automatically complete request when it starts to parallelize processing
|
|
TestEndpointIncomingRequest req = requests[i];
|
|
_ = req.ProcessingStarted.Task.ContinueWith(_ => req.ProcessingCompleted.TrySetResult(true), TaskScheduler.Default);
|
|
}
|
|
|
|
var tcsStart = new TaskCompletionSource<bool>();
|
|
|
|
var loadTask = Task.Run(async () =>
|
|
{
|
|
await tcsStart.Task.ConfigureAwait(false);
|
|
for (int i = 0; i < count; i++)
|
|
{
|
|
server.ScheduleIncomingRequest(requests[i]);
|
|
}
|
|
});
|
|
|
|
tcsStart.SetResult(true);
|
|
await loadTask.ConfigureAwait(false);
|
|
|
|
// Wait for all to finish
|
|
using var cts = new CancellationTokenSource(5000);
|
|
Task<bool[]> allFinished = Task.WhenAll(Array.ConvertAll(requests, r => r.ProcessingCompleted.Task));
|
|
if (await Task.WhenAny(allFinished, Task.Delay(5000, cts.Token)).ConfigureAwait(false) != allFinished)
|
|
{
|
|
Assert.Fail("Timed out waiting for all requests to finish.");
|
|
}
|
|
|
|
for (int i = 0; i < count; i++)
|
|
{
|
|
Assert.That(requests[i].CompletedStatusCode, Is.Not.EqualTo(StatusCodes.BadServerTooBusy));
|
|
Assert.That(requests[i].CompletedStatusCode, Is.Not.EqualTo(StatusCodes.BadServerHalted));
|
|
}
|
|
}
|
|
|
|
[Test]
|
|
public async Task TestDisposeAsync()
|
|
{
|
|
using var server = new TestServer();
|
|
server.ReplaceRequestQueue(1, 1, 10);
|
|
|
|
var req1 = new TestEndpointIncomingRequest();
|
|
var req2 = new TestEndpointIncomingRequest();
|
|
|
|
server.ScheduleIncomingRequest(req1);
|
|
|
|
// Wait for req1 to start processing so it leaves the queue.
|
|
Task<bool> t1 = req1.ProcessingStarted.Task;
|
|
using (var cts1 = new CancellationTokenSource(5000))
|
|
{
|
|
if (await Task.WhenAny(t1, Task.Delay(5000, cts1.Token)).ConfigureAwait(false) != t1)
|
|
{
|
|
Assert.Fail("Timed out waiting for processing to start.");
|
|
}
|
|
}
|
|
|
|
// req1 is active (taking the 1 thread)
|
|
// queue is now empty. Capacity is 10.
|
|
server.ScheduleIncomingRequest(req2); // Goes to queue.
|
|
|
|
// Request queue has req2 pending.
|
|
// Dispose the server, which disposes the queue.
|
|
var disposeTask = Task.Run(server.Dispose);
|
|
|
|
// req2 should be failed with BadServerHalted.
|
|
Task<bool> t2 = req2.ProcessingCompleted.Task;
|
|
using (var cts2 = new CancellationTokenSource(5000))
|
|
{
|
|
if (await Task.WhenAny(t2, Task.Delay(5000, cts2.Token)).ConfigureAwait(false) != t2)
|
|
{
|
|
Assert.Fail("Timed out waiting for req2 processing to be completed via Dispose.");
|
|
}
|
|
}
|
|
Assert.That(req2.CompletedStatusCode, Is.EqualTo(StatusCodes.BadServerHalted));
|
|
|
|
// Scheduling a new request should immediately fail with BadServerHalted
|
|
var req3 = new TestEndpointIncomingRequest();
|
|
server.ScheduleIncomingRequest(req3);
|
|
|
|
// req3 should be rejected synchronously or near-synchronously; wait briefly.
|
|
using (var cts3 = new CancellationTokenSource(5000))
|
|
{
|
|
await Task.WhenAny(req3.ProcessingCompleted.Task, Task.Delay(5000, cts3.Token))
|
|
.ConfigureAwait(false);
|
|
}
|
|
|
|
Assert.That(req3.CompletedStatusCode, Is.EqualTo(StatusCodes.BadServerHalted));
|
|
|
|
req1.ProcessingCompleted.TrySetResult(true);
|
|
await disposeTask.ConfigureAwait(false);
|
|
}
|
|
|
|
[Test]
|
|
public async Task ParkedRequestReleasesWorkerForNextRequestAsync()
|
|
{
|
|
using var server = new TestServer();
|
|
|
|
// A single worker: only the park decoupling can let a second request be
|
|
// serviced while the first is still parked waiting for a notification.
|
|
server.ReplaceRequestQueue(1, 1, 10, decoupleHeldPublishRequests: true);
|
|
|
|
var reqA = new ParkableTestRequest();
|
|
var reqB = new ParkableTestRequest();
|
|
|
|
server.ScheduleIncomingRequest(reqA);
|
|
await AwaitOrFailAsync(reqA.ProcessingStarted.Task, "request A to start").ConfigureAwait(false);
|
|
|
|
server.ScheduleIncomingRequest(reqB);
|
|
await AwaitOrFailAsync(reqB.ProcessingStarted.Task, "request B to start while A is parked")
|
|
.ConfigureAwait(false);
|
|
|
|
Assert.That(
|
|
reqA.ProcessingCompleted.Task.IsCompleted,
|
|
Is.False,
|
|
"Request A should still be parked while B is serviced.");
|
|
|
|
reqA.ProcessingCompleted.TrySetResult(true);
|
|
reqB.ProcessingCompleted.TrySetResult(true);
|
|
}
|
|
|
|
[Test]
|
|
public async Task DisabledDecouplingKeepsWorkerBlockedUntilCompletionAsync()
|
|
{
|
|
using var server = new TestServer();
|
|
|
|
// Decoupling disabled: the single worker stays bound to the parked request,
|
|
// so a second request cannot start until the first completes.
|
|
server.ReplaceRequestQueue(1, 1, 10, decoupleHeldPublishRequests: false);
|
|
|
|
var reqA = new ParkableTestRequest();
|
|
var reqB = new ParkableTestRequest();
|
|
|
|
server.ScheduleIncomingRequest(reqA);
|
|
await AwaitOrFailAsync(reqA.ProcessingStarted.Task, "request A to start").ConfigureAwait(false);
|
|
|
|
server.ScheduleIncomingRequest(reqB);
|
|
|
|
bool bStarted = await CompletedWithinAsync(reqB.ProcessingStarted.Task, 500).ConfigureAwait(false);
|
|
Assert.That(
|
|
bStarted,
|
|
Is.False,
|
|
"Request B must not start while the only worker is blocked on parked A.");
|
|
|
|
// Completing A frees the worker to service B.
|
|
reqA.ProcessingCompleted.TrySetResult(true);
|
|
await AwaitOrFailAsync(reqB.ProcessingStarted.Task, "request B to start after A completes")
|
|
.ConfigureAwait(false);
|
|
reqB.ProcessingCompleted.TrySetResult(true);
|
|
}
|
|
|
|
[Test]
|
|
public async Task ManyParkedRequestsAreServedBySmallWorkerPoolAsync()
|
|
{
|
|
using var server = new TestServer();
|
|
|
|
// Two workers must be able to service far more concurrently-parked requests
|
|
// than the worker count, because a parked request does not hold a worker.
|
|
server.ReplaceRequestQueue(2, 2, 1000, decoupleHeldPublishRequests: true);
|
|
|
|
const int count = 200;
|
|
var requests = new ParkableTestRequest[count];
|
|
for (int i = 0; i < count; i++)
|
|
{
|
|
requests[i] = new ParkableTestRequest();
|
|
server.ScheduleIncomingRequest(requests[i]);
|
|
}
|
|
|
|
Task allStarted = Task.WhenAll(Array.ConvertAll(requests, r => r.ProcessingStarted.Task));
|
|
await AwaitOrFailAsync(allStarted, "all parked requests to start", 15000).ConfigureAwait(false);
|
|
|
|
// None of them have completed - they are all still parked - yet all were
|
|
// admitted and started by only two workers.
|
|
foreach (ParkableTestRequest request in requests)
|
|
{
|
|
Assert.That(
|
|
request.CompletedStatusCode,
|
|
Is.Null,
|
|
"A parked request should not have been faulted.");
|
|
request.ProcessingCompleted.TrySetResult(true);
|
|
}
|
|
}
|
|
|
|
private static async Task AwaitOrFailAsync(Task task, string what, int timeoutMs = 5000)
|
|
{
|
|
using var cts = new CancellationTokenSource();
|
|
var delay = Task.Delay(timeoutMs, cts.Token);
|
|
if (await Task.WhenAny(task, delay).ConfigureAwait(false) != task)
|
|
{
|
|
Assert.Fail($"Timed out waiting for {what}.");
|
|
}
|
|
cts.Cancel();
|
|
await task.ConfigureAwait(false);
|
|
}
|
|
|
|
private static async Task<bool> CompletedWithinAsync(Task task, int timeoutMs)
|
|
{
|
|
using var cts = new CancellationTokenSource();
|
|
var delay = Task.Delay(timeoutMs, cts.Token);
|
|
Task completed = await Task.WhenAny(task, delay).ConfigureAwait(false);
|
|
cts.Cancel();
|
|
return completed == task;
|
|
}
|
|
}
|
|
}
|