From: Tanaka Akira Date: 2005-04-15T19:04:01+09:00 Subject: Re: EINTR Error Causing Failure in E-mail Sending Script In article <425E7EA3.9080801@bengribaudo.com>, Ben Gribaudo writes: > The impression I received from the ruby-talk archives on how to resolve > this issue is to catch the Errno::EINTR exception and retry the block > until the the code succeeds. Like: > def mail(message) > begin > Net::SMTP.start("localhost", 25) do |smtp| > smtp.sendmail(message.to_s, message.from.address, > message.to.address) > end > rescue Errno::EINTR > retry > end > end > > Does this sound like a wise* and re*asonable solution? Can any of you > shed more light as to why we encounter the EINTR error? Is it a > threading/signal handling issue in Ruby or something we are doing in our > application or ... ? I'm not sure why EINTR. However I think it's better to restart sysread itself instead of Net::SMTP.start. readpartial can be used instead since 1.8.3. readpartial doesn't raise EINTR. -- Tanaka Akira