[ruby-dev:49164] [Ruby trunk - Bug #11060] load(fifo) blocks whole process

From: franck@...
Date: 2015-07-03 11:05:55 UTC
List: ruby-dev #49164
Issue #11060 has been updated by Franck Verrot.


Nobuyoshi Nakada wrote:
> Franck Verrot wrote:
> > I can't reproduce the same errors without correcting the typo (or I'm g=
etting a `NameError: undefined local variable or method ```pi' for main:Obj=
ect` in the threads).
>=20
> It's your typo, not `pi` but `p i`.

My automatic translator tricked me :-)

> > Once running, it seems that loading from a FIFO isn't supported (it's e=
xpecting a regular file). Here's a patch for making `load` work with FIFO f=
iles.
>=20
> It's a different story, please file a new ticket if you think it useful.

Yes it is, so here's the proposal: https://bugs.ruby-lang.org/issues/11273 =
Thanks!

----------------------------------------
Bug #11060: load(fifo) blocks whole process
https://bugs.ruby-lang.org/issues/11060#change-53259

* Author: Akira Tanaka
* Status: Closed
* Priority: Normal
* Assignee:=20
* ruby -v: ruby 2.3.0dev (2015-04-12 trunk 50257) [x86_64-linux]
* Backport: 2.0.0: WONTFIX, 2.1: DONE, 2.2: REQUIRED
----------------------------------------
fifo =E3=82=92 load =E3=81=97=E3=82=88=E3=81=86=E3=81=A8=E3=81=99=E3=82=8B=
=E3=81=A8=E3=80=81=E3=83=97=E3=83=AD=E3=82=BB=E3=82=B9=E5=85=A8=E4=BD=93=E3=
=81=8C=E3=83=96=E3=83=AD=E3=83=83=E3=82=AF=E3=81=97=E3=81=BE=E3=81=99=E3=80=
=82

=E4=BB=A5=E4=B8=8B=E3=81=A7=E3=81=AF=E3=80=810.1 =E7=A7=92=E6=AF=8E=E3=81=
=AB=E8=A1=A8=E7=A4=BA=E3=82=92=E8=A1=8C=E3=81=86=E3=82=B9=E3=83=AC=E3=83=83=
=E3=83=89=E3=82=92=E4=BD=9C=E3=81=A3=E3=81=A6=E3=81=84=E3=81=BE=E3=81=99=E3=
=81=8C=E3=80=81
0.5 =E7=A7=92=E5=BE=8C=E3=81=AB load =E3=81=8C=E5=91=BC=E3=81=B0=E3=82=8C=
=E3=82=8B=E3=81=A8=E8=A1=A8=E7=A4=BA=E3=81=8C=E9=80=94=E5=88=87=E3=82=8C=E3=
=81=BE=E3=81=99=E3=80=82

```
% mkfifo fifo.rb=20=20=20=20=20=20=20=20=20
% ls -l fifo.rb=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20
prw-r--r-- 1 akr akr 0 Apr 12 17:13 fifo.rb
% ./ruby -ve 'Thread.new { 0.step {|i| p i; sleep 0.1 } }; sleep 0.5; load =
"fifo.rb"'
ruby 2.3.0dev (2015-04-12 trunk 50257) [x86_64-linux]
0
1
2
3
4
^C5
-e:1:in `new': Interrupt
	from -e:1:in `load'
	from -e:1:in `<main>'
```

=E5=BD=93=E7=84=B6=E3=80=81timeout =E3=82=82=E5=8A=B9=E3=81=8D=E3=81=BE=E3=
=81=9B=E3=82=93=E3=80=82

```
% ./ruby -rtimeout -ve 'Thread.new { 0.step {|i| p i; sleep 0.1 } }; sleep =
0.5; timeout(1) { load "fifo.rb" }'
ruby 2.3.0dev (2015-04-12 trunk 50257) [x86_64-linux]
0
1
2
3
4
^C5
-e:1:in `new': Interrupt
	from -e:1:in `load'
	from -e:1:in `block in <main>'
	from /home/ruby/tst1/lib/ruby/2.3.0/timeout.rb:89:in `block in timeout'
	from /home/ruby/tst1/lib/ruby/2.3.0/timeout.rb:34:in `block in catch'
	from /home/ruby/tst1/lib/ruby/2.3.0/timeout.rb:34:in `catch'
	from /home/ruby/tst1/lib/ruby/2.3.0/timeout.rb:34:in `catch'
	from /home/ruby/tst1/lib/ruby/2.3.0/timeout.rb:104:in `timeout'
	from /home/ruby/tst1/lib/ruby/2.3.0/timeout.rb:125:in `timeout'
	from -e:1:in `<main>'
```

=E3=81=93=E3=81=AE=E6=8C=99=E5=8B=95=E3=82=92=E3=83=90=E3=82=B0=E3=81=A8=E8=
=80=83=E3=81=88=E3=82=8B=E3=81=B9=E3=81=8D=E3=81=8B=E3=81=A9=E3=81=86=E3=81=
=8B=E3=81=AF=E3=81=84=E3=81=BE=E3=81=B2=E3=81=A8=E3=81=A4=E7=A2=BA=E4=BF=A1=
=E3=81=8C=E6=8C=81=E3=81=A6=E3=81=AA=E3=81=84=E3=81=AE=E3=81=A7=E3=81=99=E3=
=81=8C=E3=80=81
=E3=81=84=E3=81=BE=E3=81=AE=E3=81=A8=E3=81=93=E3=82=8D=E3=83=90=E3=82=B0=E3=
=81=A7=E3=81=82=E3=81=A3=E3=81=A6=E3=82=82=E3=81=8A=E3=81=8B=E3=81=97=E3=81=
=8F=E3=81=AA=E3=81=84=E3=81=A8=E6=80=9D=E3=81=A3=E3=81=A6=E3=81=84=E3=81=BE=
=E3=81=99=E3=80=82



---Files--------------------------------
0001-file.c-load-now-supports-reading-from-a-FIFO-file.patch (3.26 KB)


--=20
https://bugs.ruby-lang.org/

In This Thread

Prev Next