Repository navigation
[mono] Portable threadpool does not support async IO eg ThreadPoolBoundHandle on Windows #34582
Copy link
Copy link
Closed
Labels
area-VM-threading-monohelp wanted[up-for-grabs] Good issue for external contributors[up-for-grabs] Good issue for external contributorsos-windowsruntime-monospecific to the Mono runtimespecific to the Mono runtime
Milestone
Description
A lot of System.IO.Pipes.Tests fail with System.PlatformNotSupportedException : This API is specific to the way in which Windows handles asynchronous I/O, and is not supported on this platform. on windows.
The example of the output:
System.IO.Pipes.Tests.NamedPipeTest_Simple_ServerInOutRead_ClientInOutWrite.OperationsOnDisconnectedClient [FAIL]
System.PlatformNotSupportedException : This API is specific to the way in which Windows handles asynchronous I/O, and is not supported on this platform.
Stack Trace:
_\src\libraries\System.Private.CoreLib\src\System\Threading\ThreadPoolBoundHandle.PlatformNotSupported.cs(25,0): at System.Threading.ThreadPoolBoundHandle.BindHandle(SafeHandle handle)
_\src\libraries\System.IO.Pipes\src\System\IO\Pipes\PipeStream.Windows.cs(46,0): at System.IO.Pipes.PipeStream.InitializeAsyncHandle(SafePipeHandle handle)
_\src\libraries\System.IO.Pipes\src\System\IO\Pipes\PipeStream.cs(101,0): at System.IO.Pipes.PipeStream.InitializeHandle(SafePipeHandle handle, Boolean isExposed, Boolean isAsync)
_\src\libraries\System.IO.Pipes\src\System\IO\Pipes\NamedPipeServerStream.Windows.cs(122,0): at System.IO.Pipes.NamedPipeServerStream.Create(String pipeName, PipeDirection direction, Int32 maxNumberOfServerInstances, PipeTransmissionMode transmissionMode, PipeOptions options, Int32 inBufferSize, Int32 outBufferSize, PipeSecurity pipeSecurity, HandleInheritability inheritability, PipeAccessRights additionalAccessRights)
_\src\libraries\System.IO.Pipes\src\System\IO\Pipes\NamedPipeServerStream.Windows.cs(49,0): at System.IO.Pipes.NamedPipeServerStream.Create(String pipeName, PipeDirection direction, Int32 maxNumberOfServerInstances, PipeTransmissionMode transmissionMode, PipeOptions options, Int32 inBufferSize, Int32 outBufferSize, HandleInheritability inheritability)
_\src\libraries\System.IO.Pipes\src\System\IO\Pipes\NamedPipeServerStream.cs(85,0): at System.IO.Pipes.NamedPipeServerStream..ctor(String pipeName, PipeDirection direction, Int32 maxNumberOfServerInstances, PipeTransmissionMode transmissionMode, PipeOptions options, Int32 inBufferSize, Int32 outBufferSize, HandleInheritability inheritability)
_\src\libraries\System.IO.Pipes\src\System\IO\Pipes\NamedPipeServerStream.cs(41,0): at System.IO.Pipes.NamedPipeServerStream..ctor(String pipeName, PipeDirection direction, Int32 maxNumberOfServerInstances, PipeTransmissionMode transmissionMode, PipeOptions options)
_\src\libraries\System.IO.Pipes\tests\NamedPipeTests\NamedPipeTest.Simple.cs(761,0): at System.IO.Pipes.Tests.NamedPipeTest_Simple_ServerInOutRead_ClientInOutWrite.CreateNamedPipePair(PipeOptions serverOptions, PipeOptions clientOptions)
_\src\libraries\System.IO.Pipes\tests\NamedPipeTests\NamedPipeTestBase.cs(42,0): at System.IO.Pipes.Tests.NamedPipeTestBase.CreateNamedPipePair()
_\src\libraries\System.IO.Pipes\tests\NamedPipeTests\NamedPipeTest.Simple.cs(310,0): at System.IO.Pipes.Tests.NamedPipeTest_Simple.OperationsOnDisconnectedClient()
The whole namespace will be marked with ActiveIssue in #32592
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
area-VM-threading-monohelp wanted[up-for-grabs] Good issue for external contributors[up-for-grabs] Good issue for external contributorsos-windowsruntime-monospecific to the Mono runtimespecific to the Mono runtime
Activity
danmoseley commentedon Apr 7, 2020
@MaximLipnin this is because Mono corelib is not built with
<FeaturePortableThreadPool>true</FeaturePortableThreadPool>. Should it be?cc @kouvel
MaximLipnin commentedon Apr 7, 2020
@danmosemsft Thanks for clarification, but please correct me if I'm wrong - a quick search shows that this flag is activated in Mono's SPC
kouvel commentedon Apr 7, 2020
The portable thread pool implementation currently doesn't support
BindHandle. I guess that Mono would inherit the PNSE implementation here:runtime/src/libraries/System.Private.CoreLib/src/System.Private.CoreLib.Shared.projitems
Lines 1807 to 1810 in 893882f
I guess IO completion stuff may need to be added to the portable implementation on Windows to make
BindHandlework there, I don't know if Mono has an alternative implementation it can fork to easily at the moment for those. Probably would be best to add that to the portable implementation.marek-safar commentedon Apr 8, 2020
This is correct.
Could the tests be guarded with IsBindHandleSupported instead of Windows only or is the BindHandle support something your team can fix?
I know @jkotas would like to use portable TP for CoreCLR too and this could be a blocker.
jkotas commentedon Apr 8, 2020
Adding implementation for IO completion stuff (ie
BindHandleand friends) is one of the things that will need to be fixed to fully switch to portable TP for CoreCLR on Windows.To understand the priority: Is Mono going to ship as officially supported on Windows for .NET 5?
marek-safar commentedon Apr 8, 2020
It's not high on our priority list to support IO completion stuff anywhere (including Windows)
danmoseley commentedon Apr 9, 2020
I am interested in this too as it helps us understand what to do about these mono-on-Windows bugs. My assumption is that there is value in getting this test pass clean, regardless.
cc @steveisok
[-][mono] Tests failed due to PNSE on windows: System.IO.Pipes.Tests[/-][+][mono] Portable threadpool does not support async IO eg ThreadPoolBoundHandle[/+]6 remaining items
Fix Hosting tests in runtime-staging runs (#52265)
[-][mono] Portable threadpool does not support async IO eg ThreadPoolBoundHandle[/-][+][mono] Portable threadpool does not support async IO eg ThreadPoolBoundHandle on Windows[/+]SamMonoRT commentedon Jul 26, 2021
Moving to 7.0.0
lateralusX commentedon Jan 13, 2022
@kouvel, any plans to actually implement support in portable thread pool so we can get this working on Mono?
kouvel commentedon Jan 20, 2022
Yes I'm planning on adding support for BindHandle in the portable thread pool soon.
Reenable HostApplicationBuilderTests disabled on Mono/Windows
Reenable HostApplicationBuilderTests disabled on Mono/Windows (#66521)