Skip to content

undefined "close_on_exec=" for TCPSocket #4858

@HoneyryderChuck

Description

@HoneyryderChuck

Environment

  • JRuby versions: 9.1.13.0 and 9.1.14.0
  • Operating system and platform: Darwin Macintosh.lan 16.7.0 Darwin Kernel Version 16.7.0: Wed Oct 4 00:17:00 PDT 2017; root:xnu-3789.71.6~1/RELEASE_X86_64 x86_64

I'm getting the following error when using the "close_on_exec" APIs in TCP Server/Sockets:

require 'socket'
s = TCPServer.new("localhost", 9999)
s.close_on_exec = true
s.close_on_exec = true
# NotImplementedError: close_on_exec=
# 	from org/jruby/RubyIO.java:2172:in `close_on_exec='

At first I just thought this was one of the MRI/JRuby differences, but then I saw there are tests implemented for this in jruby, and the "did you mean" functionality throws out some weird errors when I'm pretty close to the method name:

s.close_on_exec
irb(main):006:0> s.close_on_exec
# NoMethodError: undefined method `close_on_exec' for #<TCPServer:fd 20>
# Did you mean?  close_on_exec?
#              close_on_exec=
#	from (irb):6:in `<eval>'
s.close_on_exec? # this should actually be defined, this is also a bug
# NotImplementedError: close_on_exec=
#	from org/jruby/RubyIO.java:2178:in `close_on_exec?'
#	from (irb):7:in `<eval>'

From what I understood, this should be implemented, and it's important for the "exec and keep IOs open in child process" functionality, which jruby should support.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions