Skip to content

Commit ca56fee

Browse files
committed
Missed conflicts
1 parent 4dd0a6c commit ca56fee

File tree

8 files changed

+0
-308
lines changed

8 files changed

+0
-308
lines changed

eng/Baseline.Designer.props

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,7 @@
22
<Project>
33
<PropertyGroup>
44
<MSBuildAllProjects>$(MSBuildAllProjects);$(MSBuildThisFileFullPath)</MSBuildAllProjects>
5-
<<<<<<< HEAD
65
<AspNetCoreBaselineVersion>3.1.1</AspNetCoreBaselineVersion>
7-
=======
8-
<AspNetCoreBaselineVersion>2.1.15</AspNetCoreBaselineVersion>
9-
>>>>>>> release/2.1
106
</PropertyGroup>
117
<!-- Package: AspNetCoreRuntime.3.0.x64-->
128
<PropertyGroup Condition=" '$(PackageId)' == 'AspNetCoreRuntime.3.0.x64' ">

src/PackageArchive/Archive.CiServer.Patch.Compat/ArchiveBaseline.2.1.15.txt

Lines changed: 0 additions & 1 deletion
This file was deleted.

src/PackageArchive/Archive.CiServer.Patch/ArchiveBaseline.2.1.15.txt

Lines changed: 0 additions & 1 deletion
This file was deleted.

src/SignalR/common/Http.Connections/src/Internal/HttpConnectionContext.cs

Lines changed: 0 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,7 @@ internal class HttpConnectionContext : ConnectionContext,
3333
{
3434
private static long _tenSeconds = TimeSpan.FromSeconds(10).Ticks;
3535

36-
<<<<<<< HEAD
3736
private readonly object _stateLock = new object();
38-
=======
39-
>>>>>>> release/2.1
4037
private readonly object _itemsLock = new object();
4138
private readonly object _heartbeatLock = new object();
4239
private List<(Action<object> handler, object state)> _heartbeatHandlers;
@@ -49,10 +46,6 @@ internal class HttpConnectionContext : ConnectionContext,
4946
private bool _activeSend;
5047
private long _startedSendTime;
5148
private readonly object _sendingLock = new object();
52-
<<<<<<< HEAD
53-
=======
54-
55-
>>>>>>> release/2.1
5649
internal CancellationToken SendingToken { get; private set; }
5750

5851
// This tcs exists so that multiple calls to DisposeAsync all wait asynchronously
@@ -299,7 +292,6 @@ private async Task WaitOnTasks(Task applicationTask, Task transportTask, bool cl
299292
// Wait for either to finish
300293
var result = await Task.WhenAny(applicationTask, transportTask);
301294

302-
<<<<<<< HEAD
303295
// If the application is complete, complete the transport pipe (it's the pipe to the transport)
304296
if (result == applicationTask)
305297
{
@@ -341,25 +333,6 @@ private async Task WaitOnTasks(Task applicationTask, Task transportTask, bool cl
341333

342334
Transport?.Output.Complete();
343335
Transport?.Input.Complete();
344-
=======
345-
// Normally it isn't safe to try and acquire this lock because the Send can hold onto it for a long time if there is backpressure
346-
// It is safe to wait for this lock now because the Send will be in one of 4 states
347-
// 1. In the middle of a write which is in the middle of being canceled by the CancelPendingFlush above, when it throws
348-
// an OperationCanceledException it will complete the PipeWriter which will make any other Send waiting on the lock
349-
// throw an InvalidOperationException if they call Write
350-
// 2. About to write and see that there is a pending cancel from the CancelPendingFlush, go to 1 to see what happens
351-
// 3. Enters the Send and sees the Dispose state from DisposeAndRemoveAsync and releases the lock
352-
// 4. No Send in progress
353-
await WriteLock.WaitAsync();
354-
try
355-
{
356-
// Complete the applications read loop
357-
Application?.Output.Complete(transportTask.Exception?.InnerException);
358-
}
359-
finally
360-
{
361-
WriteLock.Release();
362-
>>>>>>> release/2.1
363336
}
364337

365338
Application?.Input.CancelPendingRead();
@@ -401,7 +374,6 @@ private async Task WaitOnTasks(Task applicationTask, Task transportTask, bool cl
401374
}
402375
}
403376

404-
<<<<<<< HEAD
405377
internal bool TryActivatePersistentConnection(
406378
ConnectionDelegate connectionDelegate,
407379
IHttpTransport transport,
@@ -582,8 +554,6 @@ private async Task ExecuteApplication(ConnectionDelegate connectionDelegate)
582554
await connectionDelegate(this);
583555
}
584556

585-
=======
586-
>>>>>>> release/2.1
587557
internal void StartSendCancellation()
588558
{
589559
lock (_sendingLock)
@@ -593,18 +563,10 @@ internal void StartSendCancellation()
593563
_sendCts = new CancellationTokenSource();
594564
SendingToken = _sendCts.Token;
595565
}
596-
<<<<<<< HEAD
597-
=======
598-
599-
>>>>>>> release/2.1
600566
_startedSendTime = DateTime.UtcNow.Ticks;
601567
_activeSend = true;
602568
}
603569
}
604-
<<<<<<< HEAD
605-
=======
606-
607-
>>>>>>> release/2.1
608570
internal void TryCancelSend(long currentTicks)
609571
{
610572
lock (_sendingLock)
@@ -618,10 +580,6 @@ internal void TryCancelSend(long currentTicks)
618580
}
619581
}
620582
}
621-
<<<<<<< HEAD
622-
=======
623-
624-
>>>>>>> release/2.1
625583
internal void StopSendCancellation()
626584
{
627585
lock (_sendingLock)

src/SignalR/common/Http.Connections/src/Internal/HttpConnectionDispatcher.cs

Lines changed: 0 additions & 97 deletions
Original file line numberDiff line numberDiff line change
@@ -142,11 +142,7 @@ private async Task ExecuteAsync(HttpContext context, ConnectionDelegate connecti
142142
connection.SupportedFormats = TransferFormat.Text;
143143

144144
// We only need to provide the Input channel since writing to the application is handled through /send.
145-
<<<<<<< HEAD
146145
var sse = new ServerSentEventsServerTransport(connection.Application.Input, connection.ConnectionId, connection, _loggerFactory);
147-
=======
148-
var sse = new ServerSentEventsTransport(connection.Application.Input, connection.ConnectionId, connection, _loggerFactory);
149-
>>>>>>> release/2.1
150146

151147
await DoPersistentConnection(connectionDelegate, sse, context, connection);
152148
}
@@ -195,83 +191,9 @@ private async Task ExecuteAsync(HttpContext context, ConnectionDelegate connecti
195191

196192
if (!await connection.CancelPreviousPoll(context))
197193
{
198-
<<<<<<< HEAD
199194
// Connection closed. It's already set the response status code.
200195
return;
201196
}
202-
=======
203-
if (connection.Status == HttpConnectionStatus.Disposed)
204-
{
205-
Log.ConnectionDisposed(_logger, connection.ConnectionId);
206-
207-
// The connection was disposed
208-
context.Response.StatusCode = StatusCodes.Status404NotFound;
209-
context.Response.ContentType = "text/plain";
210-
return;
211-
}
212-
213-
if (connection.Status == HttpConnectionStatus.Active)
214-
{
215-
var existing = connection.GetHttpContext();
216-
Log.ConnectionAlreadyActive(_logger, connection.ConnectionId, existing.TraceIdentifier);
217-
}
218-
219-
using (connection.Cancellation)
220-
{
221-
// Cancel the previous request
222-
connection.Cancellation?.Cancel();
223-
224-
try
225-
{
226-
// Wait for the previous request to drain
227-
await connection.PreviousPollTask;
228-
}
229-
catch (OperationCanceledException)
230-
{
231-
// Previous poll canceled due to connection closing, close this poll too
232-
context.Response.ContentType = "text/plain";
233-
context.Response.StatusCode = StatusCodes.Status204NoContent;
234-
return;
235-
}
236-
237-
connection.PreviousPollTask = currentRequestTcs.Task;
238-
}
239-
240-
// Mark the connection as active
241-
connection.Status = HttpConnectionStatus.Active;
242-
243-
// Raise OnConnected for new connections only since polls happen all the time
244-
if (connection.ApplicationTask == null)
245-
{
246-
Log.EstablishedConnection(_logger);
247-
248-
connection.ApplicationTask = ExecuteApplication(connectionDelegate, connection);
249-
250-
context.Response.ContentType = "application/octet-stream";
251-
252-
// This request has no content
253-
context.Response.ContentLength = 0;
254-
255-
// On the first poll, we flush the response immediately to mark the poll as "initialized" so future
256-
// requests can be made safely
257-
connection.TransportTask = context.Response.Body.FlushAsync();
258-
}
259-
else
260-
{
261-
Log.ResumingConnection(_logger);
262-
263-
// REVIEW: Performance of this isn't great as this does a bunch of per request allocations
264-
connection.Cancellation = new CancellationTokenSource();
265-
266-
var timeoutSource = new CancellationTokenSource();
267-
var tokenSource = CancellationTokenSource.CreateLinkedTokenSource(connection.Cancellation.Token, context.RequestAborted, timeoutSource.Token);
268-
269-
// Dispose these tokens when the request is over
270-
context.Response.RegisterForDispose(timeoutSource);
271-
context.Response.RegisterForDispose(tokenSource);
272-
273-
var longPolling = new LongPollingTransport(timeoutSource.Token, connection.Application.Input, _loggerFactory, connection);
274-
>>>>>>> release/2.1
275197

276198
// Create a new Tcs every poll to keep track of the poll finishing, so we can properly wait on previous polls
277199
var currentRequestTcs = new TaskCompletionSource<object>(TaskCreationOptions.RunContinuationsAsynchronously);
@@ -314,23 +236,7 @@ private async Task ExecuteAsync(HttpContext context, ConnectionDelegate connecti
314236
connection.MarkInactive();
315237
}
316238
}
317-
<<<<<<< HEAD
318239
else if (resultTask.IsFaulted || resultTask.IsCanceled)
319-
=======
320-
else if (connection.TransportTask.IsFaulted || connection.TransportTask.IsCanceled)
321-
{
322-
// Cancel current request to release any waiting poll and let dispose aquire the lock
323-
currentRequestTcs.TrySetCanceled();
324-
325-
// We should be able to safely dispose because there's no more data being written
326-
// We don't need to wait for close here since we've already waited for both sides
327-
await _manager.DisposeAndRemoveAsync(connection, closeGracefully: false);
328-
329-
// Don't poll again if we've removed the connection completely
330-
pollAgain = false;
331-
}
332-
else if (context.Response.StatusCode == StatusCodes.Status204NoContent)
333-
>>>>>>> release/2.1
334240
{
335241
// Cancel current request to release any waiting poll and let dispose acquire the lock
336242
currentRequestTcs.TrySetCanceled();
@@ -538,7 +444,6 @@ private async Task ProcessSend(HttpContext context, HttpConnectionDispatcherOpti
538444
// Other code isn't guaranteed to be able to acquire the lock before another write
539445
// even if CancelPendingFlush is called, and the other write could hang if there is backpressure
540446
connection.Application.Output.Complete();
541-
<<<<<<< HEAD
542447
return;
543448
}
544449
catch (IOException ex)
@@ -548,8 +453,6 @@ private async Task ProcessSend(HttpContext context, HttpConnectionDispatcherOpti
548453

549454
context.Response.StatusCode = StatusCodes.Status400BadRequest;
550455
context.Response.ContentType = "text/plain";
551-
=======
552-
>>>>>>> release/2.1
553456
return;
554457
}
555458

src/SignalR/common/Http.Connections/src/Internal/HttpConnectionManager.cs

Lines changed: 0 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,7 @@ internal partial class HttpConnectionManager
3232
private readonly ILogger<HttpConnectionManager> _logger;
3333
private readonly ILogger<HttpConnectionContext> _connectionLogger;
3434
private readonly bool _useSendTimeout = true;
35-
<<<<<<< HEAD
3635
private readonly TimeSpan _disconnectTimeout;
37-
=======
38-
>>>>>>> release/2.1
3936

4037
public HttpConnectionManager(ILoggerFactory loggerFactory, IHostApplicationLifetime appLifetime)
4138
: this(loggerFactory, appLifetime, Options.Create(new ConnectionOptions() { DisconnectTimeout = ConnectionOptionsSetup.DefaultDisconectTimeout }))
@@ -56,15 +53,6 @@ public HttpConnectionManager(ILoggerFactory loggerFactory, IHostApplicationLifet
5653
// Register these last as the callbacks could run immediately
5754
appLifetime.ApplicationStarted.Register(() => Start());
5855
appLifetime.ApplicationStopping.Register(() => CloseConnections());
59-
<<<<<<< HEAD
60-
=======
61-
_nextHeartbeat = new TimerAwaitable(_heartbeatTickRate, _heartbeatTickRate);
62-
63-
if (AppContext.TryGetSwitch("Microsoft.AspNetCore.Http.Connections.DoNotUseSendTimeout", out var timeoutDisabled))
64-
{
65-
_useSendTimeout = !timeoutDisabled;
66-
}
67-
>>>>>>> release/2.1
6856
}
6957

7058
public void Start()
@@ -173,31 +161,10 @@ public void Scan()
173161
// Capture the connection state
174162
var lastSeenUtc = connection.LastSeenUtcIfInactive;
175163

176-
<<<<<<< HEAD
177164
var utcNow = DateTimeOffset.UtcNow;
178165
// Once the decision has been made to dispose we don't check the status again
179166
// But don't clean up connections while the debugger is attached.
180167
if (!Debugger.IsAttached && lastSeenUtc.HasValue && (utcNow - lastSeenUtc.Value).TotalSeconds > _disconnectTimeout.TotalSeconds)
181-
=======
182-
await connection.StateLock.WaitAsync();
183-
184-
try
185-
{
186-
// Capture the connection state
187-
status = connection.Status;
188-
189-
lastSeenUtc = connection.LastSeenUtc;
190-
}
191-
finally
192-
{
193-
connection.StateLock.Release();
194-
}
195-
196-
var utcNow = DateTimeOffset.UtcNow;
197-
// Once the decision has been made to dispose we don't check the status again
198-
// But don't clean up connections while the debugger is attached.
199-
if (!Debugger.IsAttached && status == HttpConnectionStatus.Inactive && (utcNow - lastSeenUtc).TotalSeconds > 5)
200-
>>>>>>> release/2.1
201168
{
202169
Log.ConnectionTimedOut(_logger, connection.ConnectionId);
203170
HttpConnectionsEventSource.Log.ConnectionTimedOut(connection.ConnectionId);

0 commit comments

Comments
 (0)