link/unlink is exception unsafe
@hyperthunk arbeitet bereits daran.
Seit 09.11.2018.
Bewertung
Dieses Issue wurde noch nicht bewertet.
Beschreibung
Suppose I have the following code
f pid = do
link pid
blocking_operations_which_depend_on_health_of pid
unlink pid
If f is interrupted with an exception, unlink might never be called. Thus I rewrite to:
f pid = bracket_ (link pid) (unlink pid) $
blocking_operations_which_depend_on_health_of pid
But this still doesn't help, because unlink is interruptible, thus if unlink is interrupted with an exception, the process will remain linked to pid after leaving f.
How about
f pid = bracket_ (link pid) (uninterruptibleMask_ $ unlink pid) $
blocking_operations_which_depend_on_health_of pid
?
This introduces the potential for blocking indefinitely. If pid dies while unlink is executing, the link exception cannot be thrown because uninterruptibleMask_ is in effect. However, when unlink completes, the exception cannot be thrown either, because the very unlink definition does not allow it. The only way to avoid illegal behavior would be to have unlink never return or somehow don't throw the link exception (the latter looks impossible to me).
The second attempt is the one I would expect to work. The problem is determining what tweak of unlink semantics would make it to work.
I would like unlink to be uninterruptible, but I don't see how that could be implemented. An alternative is to guarantee that when unlink runs with exceptions masked, it always unlinks before returning, but it might return with an exception if it is interrupted during its execution.
- Vorherrschende Sprache
- Haskell
- Sterne
- 754
- Forks
- 101
- Ø Merge
- 1 T. 3 Std.
- Gemergte PRs (30 T.)
- 4
Entwicklungsumgebung
- Kein Dockerfile und keine Docker-Compose-Datei
- Keine Pull-Request-Vorlage
- Beitragsleitfaden lesen
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus haskell-distributed/distributed-process
-
enhancement Feature Request
Schwierigkeit 5/5 Über eine Woche Anfängerfreundlichkeit 25/100
haskell-distributed/distributed-process#486 · 1 Kommentar · 1 Reaktion ·
-
discuss enhancement Feature Request
Schwierigkeit 5/5 Über eine Woche Anfängerfreundlichkeit 25/100
haskell-distributed/distributed-process#478 · 4 Kommentare · 3 Reaktionen ·
-
enhancement Feature Request
Schwierigkeit 5/5 Über eine Woche Anfängerfreundlichkeit 15/100
haskell-distributed/distributed-process#476 · 2 Reaktionen ·
-
Demonstrating the use of Cloud Haskell for a Raft implementationEvtl. wieder frei @LaurentRDC hat das vor 488 Tagen übernommen, und es ist kein Pull Request offen. Offenenhancement Feature Request
haskell-distributed/distributed-process#475 · 3 Reaktionen · 1 zugewiesene Person ·
-
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 20/100
haskell-distributed/distributed-process#473 · 4 Kommentare · 1 Reaktion ·
Alle Issues in haskell-distributed/distributed-process
Ähnliche Issues
-
newcomers
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 62/100
JacquesCarette/Drasil#5597 ·
Maintainer antworten meist innerhalb von 4 Tagen
-
`unsafeReleaseAll` throws `ResourceRegistryUsedFromUntrackedThread` when called from an untracked threadEvtl. vergeben Ein verknüpfter Pull Request ist offen oder bereits gemergt. Offen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 80/100
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 64/100
-
bug
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 86/100
Maintainer antworten meist innerhalb von 1 Tag
-
Vim-mode indent crashes: monaco-vim's browser build inlines monaco-editor 0.33Evtl. vergeben @x-labb hat das vor 2 Tagen übernommen. Offen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
compiler-explorer/compiler-explorer#9402 ·
Maintainer antworten meist innerhalb von 1 Tag