Unix socket bind may delete an existing file when binding fails
Los mantenedores suelen responder en 3 días
Evaluación
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Aptitud para principiantes
- 55/100
- Tipo de issue
- Error
- Claridad
- Bien especificado
- Estado de actividad
- Activo
- Stack tecnológico
- scala
- Área
- networking
Línea de trabajo
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.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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
- Lenguaje dominante
- Scala
- Estrellas
- 2.5k
- Forks
- 633
- Merge medio
- 3 d 21 h
- PR fusionados (30 d)
- 13
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de typelevel/fs2
-
Reading from a socket gets stuck on Node.js 26Posiblemente ocupada Un pull request vinculado a esta issue está abierto o ya se fusionó. Abiertobug
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
Los mantenedores suelen responder en 3 días
-
Dificultad 5/5 Más de una semana Aptitud para principiantes 35/100
typelevel/fs2#3800 · 2 comentarios ·
Los mantenedores suelen responder en 3 días
-
Scala Native TLSSocket#applicationProtocol behavior is inconsistent with JVMPosiblemente ocupada @reardonj la tomó hace 23 días. Abiertobug
Dificultad 2/5 1-3 horas Aptitud para principiantes 25/100
Los mantenedores suelen responder en 3 días
-
Feature Proposal: report progress writing to socketsPosiblemente ocupada @reardonj la tomó hace 30 días. Abierto
Dificultad 5/5 Más de una semana Aptitud para principiantes 45/100
Los mantenedores suelen responder en 3 días
-
Dificultad 5/5 Más de una semana Aptitud para principiantes 25/100
typelevel/fs2#3719 · 2 comentarios ·
Los mantenedores suelen responder en 3 días
Todos los issues de typelevel/fs2
Issues similares
-
No test covers transaction re-request after a delivery timeoutPosiblemente ocupada Un pull request vinculado a esta issue está abierto o ya se fusionó. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
ergoplatform/ergo#2916 ·
Los mantenedores suelen responder en 3 días
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 66/100
Los mantenedores suelen responder en 1 día
-
Area: PDF support
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
orbeon/orbeon-forms#8055 ·
Los mantenedores suelen responder en 2 días
-
Table of downloads is too longAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
lichess-org/database#103 ·
-
kind:bug priority:major
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
Los mantenedores suelen responder en 1 día