link/unlink is exception unsafe
@hyperthunk 已经在做这个了。
开始于 2018年11月9日。
评估
这个 Issue 还没有评估数据。
描述
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.
- 主要语言
- Haskell
- 星标
- 754
- 派生
- 101
- 平均合并
- 1 天 3 小时
- 30 天内合并 PR
- 4
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
haskell-distributed/distributed-process 的其他 Issue
-
enhancement Feature Request
难度 5/5 一周以上 新手友好度 25/100
haskell-distributed/distributed-process#486 · 1 条评论 · 1 个 reaction ·
-
discuss enhancement Feature Request
难度 5/5 一周以上 新手友好度 25/100
haskell-distributed/distributed-process#478 · 4 条评论 · 3 个 reaction ·
-
enhancement Feature Request
难度 5/5 一周以上 新手友好度 15/100
haskell-distributed/distributed-process#476 · 2 个 reaction ·
-
Demonstrating the use of Cloud Haskell for a Raft implementation可能重新可做 @LaurentRDC 于 484 天前认领,目前没有进行中的 PR。 未关闭enhancement Feature Request
haskell-distributed/distributed-process#475 · 3 个 reaction · 已指派 1 人 ·
-
难度 4/5 3-5 天 新手友好度 20/100
haskell-distributed/distributed-process#473 · 4 条评论 · 1 个 reaction ·
查看 haskell-distributed/distributed-process 的全部 Issue
相似的 Issue
-
enhancement
难度 2/5 1-3 小时 新手友好度 72/100
alunduil/siren-json.hs#264 ·
维护者通常 1 天内回复
-
enhancement
难度 2/5 1-3 小时 新手友好度 78/100
alunduil/network-arbitrary#210 ·
维护者通常 1 天内回复
-
console: no way to refresh row data in Browse Rows without a full page reload可能已有人在做 @12fahed 于 1 天前认领。 未关闭k/enhancement
难度 2/5 1-3 小时 新手友好度 78/100
hasura/graphql-engine#10895 · 1 条评论 ·
-
bug
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复
-
MorphRule, DataizeRule and ContextualizeRule silently accept unknown YAML keys, unlike rewrite `Rule`可能已有人在做 @renyamamoto2026-cmyk 于 2 天前认领。 未关闭bug
难度 2/5 1-3 小时 新手友好度 78/100
objectionary/phino#2107 ·
维护者通常 1 天内回复