Skip to content

Commit

Permalink
System.gc() is async, do not attempt to invoke it and retry sysopen a…
Browse files Browse the repository at this point in the history
…s it will always fail
  • Loading branch information
eam authored and headius committed Nov 2, 2016
1 parent e3cc519 commit 0bc03a9
Showing 1 changed file with 4 additions and 10 deletions.
14 changes: 4 additions & 10 deletions core/src/main/java/org/jruby/RubyIO.java
Expand Up @@ -1213,16 +1213,10 @@ protected static ChannelFD sysopen(Ruby runtime, String fname, int oflags, int p

fd = sysopenInternal(runtime, data);
if (fd == null) {
if (data.errno == Errno.EMFILE || data.errno == Errno.ENFILE) {
System.gc();
data.errno = null;
fd = sysopenInternal(runtime, data);
}
if (fd == null) {
if (data.errno != null) {
throw runtime.newErrnoFromErrno(data.errno, fname);
}
throw runtime.newSystemCallError(fname);
if (data.errno != null) {
throw runtime.newErrnoFromErrno(data.errno, fname.toString());
} else {
throw runtime.newSystemCallError(fname.toString());
}
}
return fd;
Expand Down

0 comments on commit 0bc03a9

Please sign in to comment.