Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: jruby/jruby
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: f507f6cb6d34
Choose a base ref
...
head repository: jruby/jruby
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: e39018052a80
Choose a head ref
  • 2 commits
  • 3 files changed
  • 1 contributor

Commits on Jan 9, 2018

  1. Copy the full SHA
    c4e7e5b View commit details
  2. Reorder close cleanup before thread wakeups.

    Fixes a race in test_io.rb:test_race_closed_stream from MRI.
    
    See https://bugs.ruby-lang.org/issues/13158
    headius committed Jan 9, 2018
    Copy the full SHA
    e390180 View commit details
Showing with 9 additions and 0 deletions.
  1. +3 −0 core/src/main/java/org/jruby/RubyIO.java
  2. +4 −0 core/src/main/java/org/jruby/util/io/OpenFile.java
  3. +2 −0 test/mri/excludes/FTPTest.rb
3 changes: 3 additions & 0 deletions core/src/main/java/org/jruby/RubyIO.java
Original file line number Diff line number Diff line change
@@ -2053,6 +2053,8 @@ protected IRubyObject rbIoClose(ThreadContext context) {
if (fptr.fd() == null) return context.nil;
final Ruby runtime = context.runtime;

fptr.finalizeFlush(context, false);

// interrupt waiting threads
fptr.interruptBlockingThreads(context);
try {
@@ -2061,6 +2063,7 @@ protected IRubyObject rbIoClose(ThreadContext context) {
} finally {
fptr.lock();
}

fptr.cleanup(runtime, false);

if (fptr.getProcess() != null) {
4 changes: 4 additions & 0 deletions core/src/main/java/org/jruby/util/io/OpenFile.java
Original file line number Diff line number Diff line change
@@ -845,6 +845,10 @@ public void finalize() {
}

public void finalize(ThreadContext context, boolean noraise) {
finalizeFlush(context, noraise);
}

public void finalizeFlush(ThreadContext context, boolean noraise) {
IRubyObject err = runtime.getNil();
ChannelFD fd = this.fd();
Closeable stdio_file = this.stdio_file;
2 changes: 2 additions & 0 deletions test/mri/excludes/FTPTest.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
exclude :test_abort, ""
exclude :test_list_read_timeout_exceeded, "needs investigation #4303"
exclude :test_status, ""
exclude :test_tls_connect_timeout, "exception-handling problem causing defined?(Colon2) to fail. #4895"
exclude :test_tls_post_connection_check, "new SSL-related failure in 2.4. See jruby/jruby-openssl#139"
exclude :test_tls_unknown_ca, "exception-handling problem causing defined?(Colon2) to fail. #4895"