[Darwin] Read() does not always return when closing the reader

オープン
#43 コメント 0 件 リアクション 1 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
38/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
go

調査の方向性

fifo_test.go の TestFifoCloseWhileReadingAndWriting から始め、macOS と Linux で make test を実行して差異を再現します。writer が開いているときの FIFO reader のクローズと保留中の Read の動作を追跡します。両方のプラットフォームで reader をクローズした後、テストが一貫して期待されるエラーを返せば完了です。

索引モデルが issue の本文から書いたものです。

説明

I'm seeing different behaviours on MacOS and Linux, when closing a reader.

When running make test with https://github.com/containerd/fifo/pull/42 applied, the TestFifoCloseWhileReadingAndWriting fails on MacOS but passes on Linux.

On MacOS, I'm seeing that if I open a writer on a FIFO, closing the reader won't unblock a pending Read() and a Write() from the writer will be received by the reader (After we close the reader):

=== RUN   TestFifoCloseWhileReadingAndWriting
    fifo_test.go:437: 
                Error Trace:    fifo_test.go:437
                Error:          An error is expected but got nil.
                Test:           TestFifoCloseWhileReadingAndWriting
    fifo_test.go:441: Read should not succeed

If there are no writers for the FIFO, closing the reader works as expected on both Linux and MacOS, i.e. the pending Read() returns the expected error (ErrReadClosed).

主要言語
Go
スター
87
フォーク
33
PR マージ指標
30日以内にマージされた PR はありません

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

containerd/fifo のほかの issue

containerd/fifo の issue をすべて見る

似ている issue

Go の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。