From: Brian Candler Date: 2003-04-09T03:09:01+09:00 Subject: Re: Problem with timeout for DBI on Solaris On Wed, Apr 09, 2003 at 01:48:33AM +0900, Daniel Berger wrote: > eval{ > alarm(5); > $dbh = DBI->connect("dbi:Oracle:$db",$login,$passwd,{ > RaiseError => 1, PrintError => 1}); > alarm(0); > }; ... > This was the result: > > "Error: DBI->connect(db) failed: ORA-12560: TNS:protocol adapter error > (DBD ERROR: OCIServerAttach)" After 5 seconds? It could also be a signal-handling issue. Ruby installs its own signal handlers for a bunch of common signals, and installs them with SA_RESTART set so that system calls don't terminate prematurely with EINTR if a signal comes along. If you change a signal handler with trap() {..} Ruby just updates its internal data structures, it doesn't touch the handlers it installed. Maybe perl just installs signal handlers in the O/S when required, which may mean in this case EINTR is sufficient to terminate the connection attempt. I had the same issue when looking at fcgi and Apache sending a SIGUSR1 to a fastcgi process to do a 'clean shutdown' Regards, Brian.