P
Pete Kazmier
Has anyone else experienced an interrupted system call when using
telnet.rb? I use it frequently to do a large provisioning job which
very rarely completes because read(2) gets interrupted. The call to
read(2) in made by this line in telnet.rb:
c = @sock.sysread(1024 * 1024)
Consequently, an exception is thrown of the type Errno::EINTR which
causes my program to fail in the middle of a telnet session. I've
fixed the problem by patching my telnet.rb with the following:
--- /usr/lib/ruby/1.8/net/telnet.rb~ 2004-10-05 13:45:15.000000000 -0400
+++ /usr/lib/ruby/1.8/net/telnet.rb 2005-01-18 15:39:53.000000000 -0500
@@ -584,6 +584,8 @@
yield nil if block_given?
end
break
+ rescue Errno::EINTR
+ retry
end
end
line
I'm not sure why the read(2) system call in being interrupted, but I
do know that restarting the call fixes my problem. Just curious if
anyone else has come across this problem.
I am using ruby 1.8.2 on a debian box.
Thanks,
Pete
telnet.rb? I use it frequently to do a large provisioning job which
very rarely completes because read(2) gets interrupted. The call to
read(2) in made by this line in telnet.rb:
c = @sock.sysread(1024 * 1024)
Consequently, an exception is thrown of the type Errno::EINTR which
causes my program to fail in the middle of a telnet session. I've
fixed the problem by patching my telnet.rb with the following:
--- /usr/lib/ruby/1.8/net/telnet.rb~ 2004-10-05 13:45:15.000000000 -0400
+++ /usr/lib/ruby/1.8/net/telnet.rb 2005-01-18 15:39:53.000000000 -0500
@@ -584,6 +584,8 @@
yield nil if block_given?
end
break
+ rescue Errno::EINTR
+ retry
end
end
line
I'm not sure why the read(2) system call in being interrupted, but I
do know that restarting the call fixes my problem. Just curious if
anyone else has come across this problem.
I am using ruby 1.8.2 on a debian box.
Thanks,
Pete