[#82706] [Ruby trunk Bug#13851] getting "can't modify string; temporarily locked" on non-frozen instances — cardoso_tiago@...
Issue #13851 has been updated by chucke (Tiago Cardoso).
3 messages
2017/09/07
[#82853] [Ruby trunk Bug#13916] Race condition when sending a signal to a new fork — russell.davis@...
Issue #13916 has been reported by russelldavis (Russell Davis).
3 messages
2017/09/19
[#82892] [Ruby trunk Bug#13921] buffered read_nonblock doesn't work as expected using SSLSocket — cardoso_tiago@...
Issue #13921 has been updated by chucke (Tiago Cardoso).
3 messages
2017/09/20
[ruby-core:83012] [Ruby trunk Bug#13941] File.exist? doesn't release gvl while waiting for (f)stat to return
From:
wolf@...
Date:
2017-09-26 00:10:22 UTC
List:
ruby-core #83012
Issue #13941 has been reported by graywolf (Gray Wolf).
----------------------------------------
Bug #13941: File.exist? doesn't release gvl while waiting for (f)stat to return
https://bugs.ruby-lang.org/issues/13941
* Author: graywolf (Gray Wolf)
* Status: Open
* Priority: Normal
* Assignee:
* Target version:
* ruby -v: ruby 2.5.0dev (2017-09-26 no_gvl_rb_stat 60025) [x86_64-linux]
* Backport: 2.2: UNKNOWN, 2.3: UNKNOWN, 2.4: UNKNOWN
----------------------------------------
When using `File.exist?`, I noticed that it doesn't release gvl while waiting for system to return from (f)stat call. This causes issues on high-latency network drives, since it freezes whole mri while waiting for system to reach the other end and get (f)stat of the file in question. Attached patched resolved this issue by using `rb_thread_call_without_gvl` to wrap the (f)stat calls. There is performance hit, but in my opinion not significant one:
$ ~/releaseruby_patch/bin/ruby bench.rb
Rehearsal ------------------------------------------------
File.exist?: 0.036412 0.056616 0.093028 ( 0.093075)
--------------------------------------- total: 0.093028sec
user system total real
File.exist?: 0.042953 0.049783 0.092736 ( 0.092804)
$ ~/releaseruby_no_patch/bin/ruby bench.rb
Rehearsal ------------------------------------------------
File.exist?: 0.056094 0.026293 0.082387 ( 0.082389)
--------------------------------------- total: 0.082387sec
user system total real
File.exist?: 0.037250 0.046702 0.083952 ( 0.083956)
It's important to stress out the these numbers are over 100000 iterations. Benchmarking script is attached as well as patch to the `file.c`, simple blocking filesystem to test this thing and test script.
Notice that File.read is not blocking already.
---Files--------------------------------
0001-Release-gvl-while-doing-f-stat.patch (3.15 KB)
--
https://bugs.ruby-lang.org/
Unsubscribe: <mailto:ruby-core-request@ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>