janestreet / janestreet/async_extra

Blocking read done with Rpc.Connection.create on FIFO (named pipes)

Open
#8 2 comments 0 reactions 0 assignees View on GitHub
forwarded-to-js-devs
Dominant language
OCaml
Stars
16
Forks
7
PR merge metrics
No merged PRs in 30d

Description

This bug report is not really satisfying because I don't know how to obtain more informations. I'm using `Rpc.Connection.create` on a reader and a writer created from named pipe, fifo [[1](https://github.com/bobot/oci/blob/b4ce2c6/src/Oci_Artefact_Api.ml#L96)]. The heartbeat is defined with a timeout of 10 min and is sent every 10 sec. I had to change the heartbeat because of deconnection even if the two communicating processes are on the same computer.

Quite often a `long async cycle` happen ranging mostly from 1 s to 10 s with some at 20s. By using strace it seems that each time it corresponds to a blocking read done on a file descriptor used in the previously mentionned `Rpc.Connection.create`. The result of the blocking read is each time, from the small samples I looked at, identical and quite small: `read(35, "\1\0\0\0\0\0\0\0\0", 131072) = 9`.

Should I do something special since I'm using fifo. Do you have suggestions for gathering more data?

Contributor guide

Open the contributing guide

Research direction

Start with src/Oci_Artefact_Api.ml at line 96 and inspect how Rpc.Connection.create is used with FIFO readers and writers. Reproduce the long async cycles while tracing the relevant file descriptor with strace, then compare the blocking reads and heartbeat behavior. Done means identifying the cause or documenting the missing data needed to diagnose it.

Written by the indexing model from the issue text.

Assessment

Tech stack
ocaml
Domain
backend, operating-systems
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.