0.01
Repository is archived
No commit activity in last 3 years
No release in over 3 years
Temporary stopgap workaround for MRI Ruby versions 2.2.7, 2.2.8, 2.2.9, 2.2.10, 2.3.4, 2.4.1 for the bug https://bugs.ruby-lang.org/issues/13632 until it gets backported
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

 Project Readme

Stopgap logo

⚠️ Disclaimer ⚠️

The best way to fix this bug is to update your interpreter. As on 24.10.2017 this bug has been fixed in 2.3.5, 2.4.2, 2.5.0 and all newer versions. Also, this gem is not fit for ARM processor architecture.

Description

A gem with a temporary stopgap workaround for MRI Ruby for the bug https://bugs.ruby-lang.org/issues/13632 until the proper fix gets backported. There are 6 versions affected 2.2.7, 2.2.8, 2.2.9, 2.2.10, 2.3.4, 2.4.1.

What does this bug look like?

You're getting a similar exception erratically in a presence of many threads:

Traceback (most recent call last):
    1: from test2.rb:9:in `block (2 levels) in <main>'
test2.rb:9:in `sysopen': stream closed in another thread (IOError)

Installation and usage

In Gemfile:

if %w(2.2.7 2.2.8 2.2.9 2.2.10 2.3.4 2.4.1).include? RUBY_VERSION
  gem "stopgap_13632", "~> 1.0", :platforms => ["mri", "mingw", "x64_mingw"]
end

Don't forget to require it:

require 'stopgap_13632'

And when an "IOError: stream closed" happens in a thread, accessing a busy IO, catch it and call the following method:

rescue IOError
  Thread.current.purge_interrupt_queue
end

It will unblock the thread and allow it to proceed.

Change log

1.1.2: Added ruby 2.2.9 support 1.2.0: Added ruby 2.2.10 support

Contributing

rake compile
rake test

Build Status Appveyor does not support 2.4.1 anymore: Build Status