IO.copy_streams are not closing filename argument IO instances. #3766

Closed
enebo opened this Issue Mar 29, 2016 · 0 comments

Comments

Projects
None yet
1 participant
@enebo
Member

enebo commented Mar 29, 2016

Environment

JRuby 1.7.25 (not sure about 9k but it will be another issue if so)

Expected Behavior

On windows ruby/spec will fail because it is trying to delete files in which an open IO object is still keep the file open. Because windows cannot delete any file which is already open then this is undesirable.

Actual Behavior

We hork...

This issue is not really noticed on non-windows machines so I marked this against windows but for non-IO passed in arguments this could potentially starve a process out of all available file descriptors. So it really affects all systems. It is just super apparent on windows :)

@enebo enebo added the windows label Mar 29, 2016

@enebo enebo added this to the JRuby 1.7.25 milestone Mar 29, 2016

enebo added a commit that referenced this issue Mar 29, 2016

Fixes #3766. IO.copy_streams are not closing filename argument IO
instances.

Solution is to close any open IO instances which were not passed in
as actual IO instances.

@enebo enebo closed this Mar 29, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment