Branch: Tag:

2007-08-15

2007-08-15 09:21:46 by Marcus Wellhardh <wellhard@roxen.com>

Backported from 5.0: engage_abs() now dumps the content of the handler queue.The handler installed by the abs now uses time() instead of time(1), to reduce risk of the time(1) value being stale.

Rev: server/base_server/roxen.pike:1.956

6:   // Per Hedbor, Henrik Grubbström, Pontus Hagland, David Hedbor and others.   // ABS and suicide systems contributed freely by Francesco Chemolli    - constant cvs_version="$Id: roxen.pike,v 1.955 2007/07/31 11:24:53 noring Exp $"; + constant cvs_version="$Id: roxen.pike,v 1.956 2007/08/15 09:21:46 wellhard Exp $";      //! @appears roxen   //!
2690: Inside #if undefined(__NT__)
   return;    }    report_debug("**** %s: ABS engaged!\n" -  "Waited more than %d minute(s).\n" -  "Trying to dump backlog: \n", +  "Waited more than %d minute(s).\n",    ctime(time()) - "\n",    query("abs_timeout"));    // Paranoia exit in case describe_all_threads below hangs.    signal(signum("SIGALRM"), low_engage_abs);    int t = alarm(20); -  + #ifdef THREADS +  report_debug("Handler queue:\n");    catch { -  +  array(mixed) queue = handle_queue->buffer[handle_queue->r_ptr..]; +  foreach(queue, mixed v) { +  if (!v) continue; +  if (!arrayp(v)) { +  report_debug(" *** Strange entry: %O ***\n", v); +  } else { +  report_debug(" %{%O, %}\n", v/({})); +  } +  } +  }; + #endif +  report_debug("Trying to dump backlog: \n"); +  catch {    // Catch for paranoia reasons.    describe_all_threads();    };
2714: Inside #if undefined(__NT__)
   if(!abs_started)    {    abs_started = 1; -  handlers_alive = time(1); +  handlers_alive = time();    report_debug("Anti-Block System Enabled.\n");    }    call_out (restart_if_stuck,10);
2729: Inside #if undefined(__NT__)
   ctime(time()) - "\n");    engage_abs(0);    } -  handle(lambda() { handlers_alive = time(1); }); +  handle(lambda() { handlers_alive = time(); });   }   #endif