[#3292] dir.c --- Dir.chdir error handling — Johan Holmberg <holmberg@...>

55 messages 2004/08/21
[#3350] Re: [PATCH] dir.c --- Dir.chdir error handling — Yukihiro Matsumoto <matz@...> 2004/09/06

Hi, Johan,

[#3351] Re: [PATCH] dir.c --- Dir.chdir error handling — "H.Yamamoto" <ocean@...2.ccsnet.ne.jp> 2004/09/06

Hello.

[#3352] Re: [PATCH] dir.c --- Dir.chdir error handling — Yukihiro Matsumoto <matz@...> 2004/09/06

Hi,

[#3353] Re: [PATCH] dir.c --- Dir.chdir error handling — nobu.nokada@... 2004/09/06

Hi,

[#3354] Re: [PATCH] dir.c --- Dir.chdir error handling — Yukihiro Matsumoto <matz@...> 2004/09/06

Hi,

[#3356] Re: [PATCH] dir.c --- Dir.chdir error handling — nobu.nokada@... 2004/09/07

Hi,

[#3369] Re: [PATCH] dir.c --- Dir.chdir error handling — "H.Yamamoto" <ocean@...2.ccsnet.ne.jp> 2004/09/09

Sorry for late posting. Typhoon striked me.....

[#3372] Re: [PATCH] dir.c --- Dir.chdir error handling — nobu.nokada@... 2004/09/10

Hi,

[#3374] Re: [PATCH] dir.c --- Dir.chdir error handling — "H.Yamamoto" <ocean@...2.ccsnet.ne.jp> 2004/09/10

[#3376] Re: [PATCH] dir.c --- Dir.chdir error handling — nobu.nokada@... 2004/09/10

Hi,

[#3378] Re: [PATCH] dir.c --- Dir.chdir error handling — "H.Yamamoto" <ocean@...2.ccsnet.ne.jp> 2004/09/11

nobu.nokada@softhome.net wrote:

[#3383] Re: [PATCH] dir.c --- Dir.chdir error handling — nobu.nokada@... 2004/09/12

Hi,

[#3384] Re: [PATCH] dir.c --- Dir.chdir error handling — "H.Yamamoto" <ocean@...2.ccsnet.ne.jp> 2004/09/13

[#3385] Re: [PATCH] dir.c --- Dir.chdir error handling — Yukihiro Matsumoto <matz@...> 2004/09/13

Hi,

[#3386] Re: [PATCH] dir.c --- Dir.chdir error handling — "H.Yamamoto" <ocean@...2.ccsnet.ne.jp> 2004/09/13

[#3387] Re: [PATCH] dir.c --- Dir.chdir error handling — ts <decoux@...> 2004/09/13

>>>>> "H" == H Yamamoto <ocean@m2.ccsnet.ne.jp> writes:

[#3392] Re: [PATCH] dir.c --- Dir.chdir error handling — "H.Yamamoto" <ocean@...2.ccsnet.ne.jp> 2004/09/14

[#3393] Re: [PATCH] dir.c --- Dir.chdir error handling — Yukihiro Matsumoto <matz@...> 2004/09/14

Hi,

[#3394] Re: [PATCH] dir.c --- Dir.chdir error handling — "H.Yamamoto" <ocean@...2.ccsnet.ne.jp> 2004/09/14

[#3395] Re: [PATCH] dir.c --- Dir.chdir error handling — ts <decoux@...> 2004/09/14

>>>>> "H" == H Yamamoto <ocean@m2.ccsnet.ne.jp> writes:

[#3399] Re: [PATCH] dir.c --- Dir.chdir error handling — "H.Yamamoto" <ocean@...2.ccsnet.ne.jp> 2004/09/15

[#3403] Re: [PATCH] dir.c --- Dir.chdir error handling — ts <decoux@...> 2004/09/15

>>>>> "H" == H Yamamoto <ocean@m2.ccsnet.ne.jp> writes:

[#3404] Re: [PATCH] dir.c --- Dir.chdir error handling — Yukihiro Matsumoto <matz@...> 2004/09/15

Hi,

[#3405] Re: [PATCH] dir.c --- Dir.chdir error handling — ts <decoux@...> 2004/09/15

>>>>> "Y" == Yukihiro Matsumoto <matz@ruby-lang.org> writes:

[#3409] Re: [PATCH] dir.c --- Dir.chdir error handling — Yukihiro Matsumoto <matz@...> 2004/09/16

Hi,

[#3416] Re: [PATCH] dir.c --- Dir.chdir error handling — ts <decoux@...> 2004/09/16

>>>>> "Y" == Yukihiro Matsumoto <matz@ruby-lang.org> writes:

[#3303] URGENT: what's the bug reporting system now? — Dave Thomas <dave@...>

Hello!

14 messages 2004/08/25

Re: Ruby is eating my signals!

From: Eric Schwartz <eric.schwartz@...>
Date: 2004-08-31 23:14:30 UTC
List: ruby-core #3334
On Tue, 2004-08-31 at 13:05, Berger, Daniel wrote:
> Well, one thing I'm curious about is why you need to setup a separate
> ALRM handler in addition to a timeout.  I would think wrapping your STAF
> query in a timeout, and catching a TimeoutError, would be sufficient.
> Please correct me if I'm wrong.

I hav tried the TimoutError approach; the problem is that the
TimeoutError never actually gets to my code, probably for the same
reason the SIGALRM handler never does.  

What's happening is that the STAF library does a connect() to the remote
system, and that connect() is what is hanging.  When Ruby recieves the
SIGALRM, rb_trap_immediate is not set, so the signal is deferred-- the
problem is, because it's hanging inside the connect(), the Ruby
internals that poll that deferred list never get called, so the signal
is effectively "eaten".

> Also, I don't see anything in your source to indicate that you've tried
> to trap the ALRM signal anywhere.  Do you have a code snippet you could
> share?  That would help.  I'm afraid I don't use STAF so I can't really
> test.

Sure:
  parent = $$
  timeout = fork do
    sleep 5
    Process.kill "ALRM", parent
  end
  begin
    cmd = STAF::STAFCommand.new(machine, STAF::PROCESS_SVC,
				"query handle #{handle}")
  rescue SignalException => se
    return false
  end
  # this prevents it from firing off after we exit.
  Process.kill -9 timeout  

> Lastly, as a sanity check, create a simple alarm handler and make sure
> it works properly on your platform (which I'm guessing is Linux, but I
> don't remember for sure):

Yes, I'm on Linux (x86).  An ordinary alarm handler works fine.

> Then try adding in timeout code similar to what you're doing with STAF.

I have done; that all works fine.

> Now, if *that* doesn't work, then there may be a bug in Ruby, or perhaps
> there's a Linux specific issue.

Hence my query. :)

-=Eric
-- 
Eric Schwartz <eric.schwartz@hp.com>
Hewlett-Packard Company Linux/Open Source Labs (LOSL)


In This Thread