Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

File locks do not release while JRuby process open in 9k-pre2 #2958

Closed
ghost opened this issue May 19, 2015 · 7 comments
Closed

File locks do not release while JRuby process open in 9k-pre2 #2958

ghost opened this issue May 19, 2015 · 7 comments

Comments

@ghost
Copy link

ghost commented May 19, 2015

While using both JRuby and JIRB to test and develop code, I have found that the process holds file locks on all source files currently loaded via a require statement. The file locks are not released until the process is terminated; both Windows itself and gEdit 2.30.1 report that the file cannot be written to until the process terminates.

For reference, the output from jruby -v produces (formatted for readability):

jruby 9.0.0.0.pre2 (2.2.2) 2015-04-28 2755ae0 Java HotSpot(TM) 
  64-Bit Server VM 25.31-b07 on 1.8.0_31-b13 +jit [Windows 7-amd64]
@headius
Copy link
Member

headius commented May 28, 2015

That is surprising...I don't think that we lock required files at all.

@chrisseaton
Copy link
Contributor

I remember looking at this for Truffle - I think that MRI at least locks files that have DATA in them. There is a spec for that https://github.com/jruby/jruby/blob/master/spec/ruby/language/predefined/data_spec.rb#L26-L42.

@headius
Copy link
Member

headius commented May 28, 2015

I just confirmed, from ExternalScript on down, that we don't actively lock any files on load.

We do, however, keep the file open for as long as we're in the process of executing it. If the file never reaches its end (i.e. if it starts up a long-running app and blocks)

DATA should only be loaded from the target script; if it's a required or loaded file, any __END__ sections are simply dropped.

@headius
Copy link
Member

headius commented Jun 2, 2015

@florf This is not currently a high priority, since we do not actively lock these files and we should be closing them after they're done loading. If you can confirm we're holding an actual filesystem-level lock, or keeping files open longer than we should, it would help us have a goal to work toward.

@headius headius added the windows label Jun 2, 2015
@ghost
Copy link
Author

ghost commented Jun 8, 2015

It could be that the required files being held open were causing the permission issues. That does make more sense now that I think about it. I'll have to do more testing to be sure.

Insofar, IRB seems to be the one causing issues.

@headius
Copy link
Member

headius commented Jul 3, 2015

I think @enebo is looking at this for RC2.

@headius headius added this to the JRuby 9.0.0.0.rc2 milestone Jul 3, 2015
@enebo
Copy link
Member

enebo commented Jul 3, 2015

I am nearly positive this is a dupe of #3055. Closing as duplicate only because I already close the other as fixed.

@enebo enebo closed this as completed Jul 3, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants