Skip to content
This repository has been archived by the owner on Jan 23, 2023. It is now read-only.
/ corefx Public archive

Don't capture AsyncLocals into HttpConnectionPools timer #26068

Merged
merged 2 commits into from
Jan 3, 2018

Conversation

benaadams
Copy link
Member

@benaadams
Copy link
Member Author

OSX

Output: Discovering: System.ComponentModel.Composition.Tests
Output: Discovered:  System.ComponentModel.Composition.Tests
Output: Starting:    System.ComponentModel.Composition.Tests
Output: requiredService: System.ComponentModel.Composition.Hosting.CompositionContainer+CompositionServiceShim
Output: optionalService: System.ComponentModel.Composition.Hosting.CompositionContainer+CompositionServiceShim
Output: /Users/dotnet-bot/dotnetbuild/work/917a3b49-3f41-4ab3-a05e-d9642823058b/Work/440e3a6f-a136-4a2d-8ba6-710aed01df21/Unzip/RunTests.sh: line 87:
 45954 Segmentation fault: 11  (core dumped) $RUNTIME_PATH/dotnet xunit.console.netcore.exe
 System.ComponentModel.Composition.Tests.dll -xml testResults.xml -notrait Benchmark=true
 -notrait category=nonnetcoreapptests -notrait category=nonosxtests -notrait category=OuterLoop -notrait category=failing
Output: Traceback (most recent call last):
Output:   File "/Users/dotnet-bot/.dumpling/dumpling.py", line 33, in <module>
Output:     import psutil
Output: ImportError: No module named psutil
Output: Trying to find crash dumps for project: System.ComponentModel.Composition.Tests
Output: Uploading dump file: /Users/dotnet-bot/dotnetbuild/work/917a3b49-3f41-4ab3-a05e-d9642823058b/Work/440e3a6f-a136-4a2d-8ba6-710aed01df21/Unzip/core.45954
Output: ~/dotnetbuild/work/917a3b49-3f41-4ab3-a05e-d9642823058b/Work/440e3a6f-a136-4a2d-8ba6-710aed01df21/Unzip
Output: Finished running tests. End time=17:15:53. Return value was 139
Exit Code: 139

@dotnet-bot test OSX x64 Debug Build

@benaadams
Copy link
Member Author

NETFX

17:19:30   xUnit.net Console Runner (64-bit Desktop .NET 4.0.30319.42000)
17:19:31     Discovering: System.IO.Compression.Tests
17:19:31     Discovered:  System.IO.Compression.Tests
17:19:31     Starting:    System.IO.Compression.Tests
17:19:34       System.IO.Compression.GzipStreamUnitTests.Dispose_WithUnfinishedWriteAsync [FAIL]
17:19:34         Assert.False() Failure
17:19:34         Expected: False
17:19:34         Actual:   True
17:19:34         Stack Trace:
17:19:34              at System.IO.Compression.CompressionStreamUnitTestBase.<Dispose_WithUnfinishedWriteAsync>d__5.MoveNext()
17:19:34           --- End of stack trace from previous location where exception was thrown ---
17:19:34              at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
17:19:34              at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
17:19:34           --- End of stack trace from previous location where exception was thrown ---
17:19:34              at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
17:19:34              at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
17:19:34           --- End of stack trace from previous location where exception was thrown ---
17:19:34              at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
17:19:34              at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
17:19:36     Finished:    System.Collections.Concurrent.Tests

@dotnet-bot test NETFX x86 Release Build

@@ -39,7 +39,12 @@ public HttpConnectionPools(int maxConnectionsPerServer)
_maxConnectionsPerServer = maxConnectionsPerServer;
_pools = new ConcurrentDictionary<HttpConnectionKey, HttpConnectionPool>();
// Start out with the timer not running, since we have no pools.

// Don't capture the current ExecutionContext and its AsyncLocals onto the timer causing them to live forever
ExecutionContext.SuppressFlow();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This needs to check whether flow was already suppressed, and then only suppress and restore flow if it wasn't already.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

@davidsh davidsh removed their assignment Jan 2, 2018
@stephentoub stephentoub merged commit d425f86 into dotnet:master Jan 3, 2018
@benaadams benaadams deleted the HttpConnectionPools branch January 3, 2018 19:33
@karelz karelz added this to the 2.1.0 milestone Jan 20, 2018
picenka21 pushed a commit to picenka21/runtime that referenced this pull request Feb 18, 2022
…fx#26068)

* Don't capture AsyncLocals into HttpConnectionPools timer

* Harden EC flow suppression


Commit migrated from dotnet/corefx@d425f86
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants