Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

IO.select does not report TCP out-of-band data as priority readiness

Đang mở
#9,506 1 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 2 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
35/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Ít trao đổi
Công nghệ
java, ruby
Lĩnh vực
networking

Hướng nghiên cứu

Start by running the reproduction script on JRuby to confirm the priority array comes back nil after Socket::MSG_OOB is sent. The payload does not name the JRuby source files that implement IO.select, so locate that code first. The fix needs to make a TCP urgent (OOB) byte mark the socket as priority-ready. Done means the script prints priority: true and exits 0, and the io-event IO::PRIORITY test can stop being skipped on JRuby.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

Environment

jruby 10.1.0.0 (4.0.0) 2026-04-20 32f988b78c OpenJDK 64-Bit Server VM 21.0.11 on 21.0.11 +indy +jit [arm64-darwin]

Compared with:

ruby 4.0.5 (2026-05-20 revision 64336ffd0e) +PRISM [arm64-darwin24]

Reproduction

# frozen_string_literal: true

require "socket"

server = TCPServer.new("127.0.0.1", 0)
client = TCPSocket.new("127.0.0.1", server.addr[1])
socket = server.accept

begin
  client.send("!", Socket::MSG_OOB)

  readable, writable, priority = IO.select(nil, nil, [socket], 1)

  puts RUBY_DESCRIPTION
  puts "priority: #{priority&.include?(socket).inspect}"

  unless priority&.include?(socket)
    warn "Expected socket to be reported as priority-ready."
    exit 1
  end
ensure
  socket&.close
  client&.close
  server&.close
end

Expected behavior

After sending TCP out-of-band data with Socket::MSG_OOB, IO.select(nil, nil, [socket], timeout) should report the socket in the priority result array.

CRuby reports:

ruby 4.0.5 (2026-05-20 revision 64336ffd0e) +PRISM [arm64-darwin24]
priority: true

Actual behavior

JRuby times out without reporting priority readiness:

jruby 10.1.0.0 (4.0.0) 2026-04-20 32f988b78c OpenJDK 64-Bit Server VM 21.0.11 on 21.0.11 +indy +jit [arm64-darwin]
priority: nil
Expected socket to be reported as priority-ready.

Context

This came up while enabling JRuby support in io-event. IO::Event::Selector::Select supports IO::PRIORITY using Ruby's IO.select priority array. The corresponding test passes on CRuby but has to be skipped on JRuby because the priority event is not reported.

Ngôn ngữ chính
Ruby
Star
3.9k
Fork
951
Merge trung bình
2 ngày 21 giờ
Pull request đã merge (30 ngày)
75

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của jruby/jruby

Tất cả issue của jruby/jruby

Issue tương tự

Thêm issue về Ruby

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.