anmonteiro / anmonteiro/gluten

gluten_lwt.ml / write_loop consumes 100% if remote side closes socket

未关闭
#85 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
主要语言
OCaml
星标
48
派生
23
PR 合并指标
30 天内没有已合并 PR

描述

function write_loop in lwt/gluten_lwt.ml fails to check the writev result. If writev writes to a socket, the socket has been closed by the remote side, and SIGPIPE has been disabled, writev will always return `Closed and write_loop will neither exit or yield, locking up the program.
I've fixed the problem by adding a check, but I'm not familiar enough with the code to do a PR.

```
match Runtime.next_write_operation t with
| `Write io_vectors ->
writev io_vectors >>= fun result ->
Runtime.report_write_result t result;
(* added check to exit loop on EPIPE *)
if result != `Closed then
write_loop_step ()
else
Lwt.return_unit
```

贡献指南

这个仓库没有索引到贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。