[wasi] TaskToAsyncResult.Begin throws PlatformNotSupportedException
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 2/5
- Tiempo estimado
- 1-3 horas
- Aptitud para principiantes
- 78/100
- Tipo de issue
- Error
- Claridad
- Bien especificado
- Estado de actividad
- Activo
- Stack tecnológico
- csharp
Línea de trabajo
Comienza en src/libraries/Common/src/System/Threading/Tasks/TaskToAsyncResult.cs e inspecciona la comprobación de WASI en Begin. Ejecuta las pruebas de TaskToAsyncResultTests, incluida InvalidArguments_ThrowExceptions, para confirmar que el wrapper de APM funciona en plataformas de un solo hilo. La tarea estará terminada cuando Begin ya no falle incondicionalmente en WASI y el comportamiento bloqueante de AsyncWaitHandle siga tratándose adecuadamente.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Description
System.Threading.Tasks.TaskToAsyncResult.Begin unconditionally throws PlatformNotSupportedException on WASI:
// src/libraries/Common/src/System/Threading/Tasks/TaskToAsyncResult.cs
public static IAsyncResult Begin(Task task, AsyncCallback? callback, object? state)
{
#if NET
if (OperatingSystem.IsWasi()) throw new PlatformNotSupportedException(); // TODO remove with https://github.com/dotnet/runtime/pull/107185
The TODO points at https://github.com/dotnet/runtime/pull/107185, a draft that added UnsupportedOSPlatform annotations for WASI; it was closed without merging. So the check remains and nothing tracks it.
Begin wraps a Task in an IAsyncResult and schedules the callback as a continuation. That does not need extra threads, although code that blocks on the returned AsyncWaitHandle would.
The APM helpers throughout the libraries go through it, so on WASI every Begin*/End* pattern built on TaskToAsyncResult fails, as does Task.Factory.FromAsync over such a pair. In the CoreCLR WASI library test runs on https://github.com/dotnet/runtime/pull/134813, all six TaskToAsyncResultTests tests that run on a single-threaded platform fail this way. That includes InvalidArguments_ThrowExceptions, which expects ArgumentNullException.
Proposed fix
Remove the WASI check so Begin works as on browser. If blocking on AsyncWaitHandle must stay unsupported, keep that limitation where the wait happens. Otherwise, annotate the API as unsupported on WASI instead of throwing unconditionally.
[!NOTE]
This issue was drafted with the help of GitHub Copilot.
- Lenguaje dominante
- C#
- Estrellas
- 18.4k
- Forks
- 5.7k
- Merge medio
- 2 d 20 h
- PR fusionados (30 d)
- 652
Preparar el entorno
Inicia el contenedor de desarrollo del proyecto en tu navegador, con tu propia cuenta de GitHub.
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de dotnet/runtime
-
area-System.IO.Compression untriaged
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
dotnet/runtime#136215 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
area-CodeGen-coreclr untriaged
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
dotnet/runtime#135849 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
[wasm] Emscripten clang wrapper fails when the SDK path contains a spacePosiblemente ocupada @agocke la tomó hace 12 días. Abiertoarch-wasm area-Infrastructure untriaged
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
dotnet/runtime#135416 · 2 comentarios · 2 reacciones · 2 asignados ·
Los mantenedores suelen responder en 1 día
-
area-System.Linq untriaged
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100
dotnet/runtime#134736 · 3 comentarios ·
Los mantenedores suelen responder en 1 día
-
[ci-scan] Hang: baseservices/threading/ThreadStateDestroyedPosiblemente ocupada Un pull request vinculado a esta issue está abierto o ya se fusionó. Abiertoarea-System.Threading blocking-clean-ci Known Build Error untriaged
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
dotnet/runtime#134679 · 4 comentarios ·
Los mantenedores suelen responder en 1 día
Todos los issues de dotnet/runtime
Issues similares
-
Bug Platform: Android
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
getsentry/sentry-dotnet#5764 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
microsoft/SimpleL7Proxy#287 ·
Los mantenedores suelen responder en 1 día
-
bug priority: P2
Dificultad 1/5 Menos de una hora Aptitud para principiantes 78/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
IridiumIO/CompactGUI#699 ·
Los mantenedores suelen responder en 3 días