From: "mame (Yusuke Endoh)" Date: 2022-06-10T06:31:27+00:00 Subject: [ruby-core:108844] [Ruby master Bug#16277] UNIXServer#listen fails with Errno::EADDRINUSE error under Windows 10 / WSL Ubuntu 18.04 Issue #16277 has been updated by mame (Yusuke Endoh). Status changed from Open to Closed I tried the script on Windows 11 / WSL2 Ubuntu 22.04, but couldn't repro the issue. I guess WSL2 solved the issue. Please ping me if it still occurs. ---------------------------------------- Bug #16277: UNIXServer#listen fails with Errno::EADDRINUSE error under Windows 10 / WSL Ubuntu 18.04 https://bugs.ruby-lang.org/issues/16277#change-97922 * Author: bradland (Brad Landers) * Status: Closed * Priority: Normal * ruby -v: ruby 2.6.5p114 (2019-10-01 revision 67812) [x86_64-linux-gnu] * Backport: 2.5: UNKNOWN, 2.6: UNKNOWN ---------------------------------------- When running the following script under Windows 10 / WSL Ubuntu 18.04, an Errno::EADDRINUSE error is thrown. Expected result is that the script would run and simply exit. ``` ruby #!/usr/bin/env ruby # This script establishes a UNIX server socket. # # Expected result: Script should run and immediately exit. # # Actual result: Script fails with Errno::EADDRINUSE error. # # Environment: Windows 10 Pro, WSL, Ubuntu 18.04.2, ruby 2.6.5p114 (2019-10-01 revision 67812) [x86_64-linux-gnu] # # To reproduce: Create a tmp folder, copy this script there, and execute. require 'socket' path = File.expand_path('listen.sock') backlog = 5 s = UNIXServer.new(path) if backlog s.listen backlog else s.listen end File.delete(path) if File.exists?(path) ``` The bug was discoverd as part of Puma (gem) issue #1521: https://github.com/puma/puma/issues/1521. -- https://bugs.ruby-lang.org/ Unsubscribe: