Skip to content

Restart dead enumerator#6190

Merged
headius merged 3 commits intojruby:masterfrom
headius:restart_dead_enumerator
Apr 24, 2020
Merged

Restart dead enumerator#6190
headius merged 3 commits intojruby:masterfrom
headius:restart_dead_enumerator

Conversation

@headius
Copy link
Member

@headius headius commented Apr 24, 2020

This fixes the remaining failure in CSV as discussed in #6157. Enumerators that fail prematurely due to an exception should be re-started on the next call to next.

headius added 3 commits April 24, 2020 15:03
This appears to be the cause of a failure in the CSV tests as
discussed at jruby#6157.

The following code should restart the Enumerator and print "0"
twice, but the second `next` triggers a "dead fiber" error without
this patch:

```ruby
Enumerator.new {
  2.times {|i| raise i.to_s }
}.tap {|f|
  2.times { f.next rescue puts $!.message }
}
```
See jruby#6157 for a CSV test that failed due to this
missing behavior in JRuby, specifically the comments here:

jruby#6157 (comment)
@headius headius added this to the JRuby 9.3.0.0 milestone Apr 24, 2020
@headius
Copy link
Member Author

headius commented Apr 24, 2020

Failure is due to my removing an exclude that doesn't fail on MacOS.

@headius
Copy link
Member Author

headius commented Apr 24, 2020

I do not agree with the restarting behavior, so I have filed https://bugs.ruby-lang.org/issues/16816

@headius headius merged commit d33827e into jruby:master Apr 24, 2020
@headius headius deleted the restart_dead_enumerator branch April 24, 2020 20:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant