[2.0 rc.20 / next] `await renderToStream` never settles when the render signal aborts
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Aptitud para principiantes
- 55/100
- Tipo de issue
- Error
- Claridad
- Bien especificado
- Estado de actividad
- Activo
- Stack tecnológico
- nodejs, typescript
- Área
- backend
Línea de trabajo
Start with the reproduction script in the issue and packages/web/src/server.ts: the promise form of renderToStream settles only through onCompleteAll or onFailure, and the abandon path on disconnect calls onDisconnectedBeforeShell instead, which the promise form never sets (around L2220-L2223). Run repro.mjs and confirm it prints still pending. Done means the promise rejects with signal.reason after an abort, and the script prints a rejected outcome.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
When the signal passed to renderToStream aborts, the render is disposed, but the promise returned for await renderToStream(...) never settles. It neither resolves nor rejects, so the caller stays pending forever and keeps whatever it holds alive: the request, timers, a concurrency slot.
The pipe paths end on abort. Only the promise form is left hanging.
Versions
solid-js and @solidjs/web 2.0.0-rc.20 from npm, and next at ab29345. Node 26.13.0.
Reproduction
Save as repro.mjs in a project with solid-js and @solidjs/web 2.0.0-rc.20, then run node repro.mjs:
import { renderToStream, ssr, escape } from "@solidjs/web";
import { createMemo } from "solid-js";
const sleep = ms => new Promise(resolve => setTimeout(resolve, ms));
function App() {
const message = createMemo(() => sleep(500).then(() => "loaded"));
return ssr(["<p>", "</p>"], () => escape(message()));
}
const controller = new AbortController();
const rendering = renderToStream(App, { signal: controller.signal });
setTimeout(() => controller.abort(new Error("client disconnected")), 50);
const outcome = await Promise.race([
Promise.resolve(rendering).then(
html => `resolved: ${html}`,
error => `rejected: ${error?.message}`
),
sleep(2000).then(() => "still pending after 2s")
]);
console.log(outcome);
process.exit(0);
Observed
still pending after 2s
Without the abort call, the same script prints resolved: <p>loaded</p>....
Expected
The promise settles once the render is abandoned. Rejecting with signal.reason would let the caller tell a cancellation apart from a finished render and release what it holds.
Cause
Inside then, the promise settles only through onCompleteAll or onFailure (packages/web/src/server.ts, L3525-L3550 on next). When abandon runs because of a disconnect, it skips onFailed and only calls onDisconnectedBeforeShell, which the promise form never sets (L2220-L2223), so neither path runs.
- Lenguaje dominante
- TypeScript
- Estrellas
- 36.2k
- Forks
- 1.1k
- Merge medio
- 10 h 10 min
- PR fusionados (30 d)
- 505
Preparar el entorno
- 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 solidjs/solid
-
Dificultad 4/5 3-5 días Aptitud para principiantes 35/100
Los mantenedores suelen responder en 1 día
-
Dificultad 5/5 Más de una semana Aptitud para principiantes 22/100
Los mantenedores suelen responder en 1 día
-
What gets passed to the `when` prop of a `Show` still gets executed twice on SSRPosiblemente ocupada @brenelz la tomó hace 4 días. Abierto1.x
Dificultad 3/5 1-2 días Aptitud para principiantes 52/100
Los mantenedores suelen responder en 1 día
-
enhancement
Dificultad 5/5 Más de una semana Aptitud para principiantes 35/100
solidjs/solid#4447 · 2 comentarios ·
Los mantenedores suelen responder en 1 día
-
enhancement
Dificultad 5/5 Más de una semana Aptitud para principiantes 35/100
Los mantenedores suelen responder en 1 día
Todos los issues de solidjs/solid
Issues similares
-
needs investigation
Dificultad 2/5 1-3 horas Aptitud para principiantes 60/100
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
Los mantenedores suelen responder en 1 día
-
Makefile names visualizer gate targets that do not exist; the TS packages have no test runnerAbiertoarea:visualizer tech-debt
Dificultad 2/5 Menos de una hora Aptitud para principiantes 66/100
jmbarzee/temporal-architect#292 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 66/100
riverqueue/river#1576 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
colbymchenry/codegraph#3228 ·
Los mantenedores suelen responder en 1 día