Unix socket bind may delete an existing file when binding fails
メンテナーはふだん 3 日以内に返信
評価
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 初心者へのやさしさ
- 55/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 技術スタック
- scala
- 領域
- networking
調査の方向性
Start with the Network[F].bind(UnixSocketAddress(...)) implementation and trace how deleteOnClose handles a failed bind. Use the provided Scala reproduction to confirm that the existing file is removed when binding raises BindException; the fix is done when a failed bind leaves the file intact while normal close behavior remains unchanged. Add or run the relevant Unix-socket binding tests once you locate the networking test suite.
索引モデルが issue の本文から書いたものです。
説明
Network[F].bind(UnixSocketAddress("/path/to/file")) deletes the file even when binding fails. deleteOnClose deletes the file not only when the socket is closed, but also when binding fails.
Reproduction:
//> using scala "3.9.0"
//> using dep "co.fs2::fs2-io:3.14.0"
import cats.effect.IO
import cats.effect.IOApp
import com.comcast.ip4s.UnixSocketAddress
import fs2.Stream
import fs2.io.file.Files
import fs2.io.net.Network
object App extends IOApp.Simple {
def run: IO[Unit] =
Files[IO].tempFile.use { path =>
for {
_ <- Stream
.emit("123456")
.through(Files[IO].writeUtf8(path))
.compile
.drain
_ <- IO.println(path)
before <- Files[IO].exists(path)
_ <- IO.println(s"Exists before bind: $before")
result <- Network[IO]
.bind(UnixSocketAddress(path.toString))
.use_
.attempt
_ <- IO.println(result)
after <- Files[IO].exists(path)
_ <- IO.println(s"Exists after failed bind: $after")
} yield ()
}
}
/tmp/17591615494821517556.tmp
Exists before bind: true
Left(java.net.BindException: Address in use)
Exists after failed bind: false
- 主要言語
- Scala
- スター
- 2.5k
- フォーク
- 633
- 平均マージ
- 4日 16時間
- マージ済み PR(30日)
- 5
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
typelevel/fs2 のほかの issue
-
Reading from a socket gets stuck on Node.js 26対応中かも このイシューにリンクされたプルリクエストがオープン中、またはマージ済みです。 オープンbug
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
メンテナーはふだん 3 日以内に返信
-
Scala Native TLSSocket#applicationProtocol behavior is inconsistent with JVM対応中かも @reardonj が 18 日前に担当しました。 オープンbug
難易度 2/5 1〜3時間 初心者へのやさしさ 25/100
メンテナーはふだん 3 日以内に返信
-
Feature Proposal: report progress writing to sockets対応中かも @reardonj が 25 日前に担当しました。 オープン
難易度 5/5 1週間以上 初心者へのやさしさ 45/100
メンテナーはふだん 3 日以内に返信
-
難易度 5/5 1週間以上 初心者へのやさしさ 25/100
typelevel/fs2#3719 · コメント 2 件 ·
メンテナーはふだん 3 日以内に返信
-
難易度 3/5 1〜2日 初心者へのやさしさ 55/100
メンテナーはふだん 3 日以内に返信
似ている issue
-
Traffic event delivered/rejected counters appear swapped in TrafficStateController.updateWithReceiptオープン
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
digital-asset/canton#705 ·
メンテナーはふだん 2 日以内に返信
-
easy first-contributor first-contributors good first issue help wanted scala up-for-grabs
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
fork-commit-merge/fork-commit-merge#8457 ·
メンテナーはふだん 1 日以内に返信
-
[GC] Empty or non-numeric GC_*_HEAP_SIZE reads out of bounds or uses an uninitialised size対応中かも @oluies が 1 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
scala-native/scala-native#5177 ·
メンテナーはふだん 1 日以内に返信
-
good first issue
難易度 1/5 1時間未満 初心者へのやさしさ 78/100
promovolve/promovolve#358 ·
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 95/100
svroonland/zio-kinesis#1431 ·