nh2 / nh2/hatrace

Properly cleanup processes in case of conduit failing with an exception

Abierto
#80 0 comentarios 0 reacciones 0 asignados Ver en GitHub
enhancement
Lenguaje dominante
Haskell
Estrellas
126
Forks
26
Métricas de merge de PR
Sin PR fusionados en 30 d

Descripción

Tests in #76 uncovered that if an exception gets thrown in a `hatrace` conduit child processes don't get cleaned up correctly. Quoting @nh2 from discord:

> ...currently an exception being thrown and not caught from inside the Conduit will leak the tracee child process. That is because
```
genericSourceTraceForkExecvFullPathWithSink args getDetails sink = runInBoundThread $ do
childPid <- liftIO $ forkExecvWithPtrace args
```
> does not use any form of bracket.
> What this needs is the same form of bracket that the sourceProcessWithStreams (https://hackage.haskell.org/package/conduit-extra-1.3.5/docs/Data-Conduit-Process.html#v:sourceProcessWithStreams) does:
> > If an exception is raised by any of the streams, the process is terminated.
>
> It is not implemented because I haven't figured out exactly yet how to "just kill" a traced process. Maybe it's easy, but I am not sure.
> We should certainly have an issue about it (currently we don't have yet).

Guía de contribución

No hay ninguna guía de contribución indexada para este repositorio

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.