Changeset de520024f8801f5cc271ac9301e66f7c3690558e

Show
Ignore:
Timestamp:
04/09/12 19:56:55 (2 years ago)
Author:
Theo Schlossnagle <jesus@omniti.com>
git-committer:
Theo Schlossnagle <jesus@omniti.com> 1334001415 +0000
git-parent:

[bc131e531806eeabd6a47f1225ee5c9839fbe01d]

git-author:
Theo Schlossnagle <jesus@omniti.com> 1334001415 +0000
Message:

Don't assert on double runs, just log an error

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • src/modules/dns.c

    r7a237a2 rde52002  
    618618  noit_hash_table check_attrs_hash = NOIT_HASH_EMPTY; 
    619619 
     620  BAIL_ON_RUNNING_CHECK(check); 
     621 
    620622  gettimeofday(&now, NULL); 
    621623  memcpy(&check->last_fire_time, &now, sizeof(now)); 
  • src/modules/external.c

    r7a237a2 rde52002  
    476476  data = noit_module_get_userdata(self); 
    477477 
     478  BAIL_ON_RUNNING_CHECK(check); 
    478479  check->flags |= NP_RUNNING; 
    479480  noitL(data->nldeb, "external_invoke(%p,%s)\n", 
  • src/modules/lua.c

    r1f9edc7 rde52002  
    776776 
    777777  /* We cannot be running */ 
    778   assert(!(check->flags & NP_RUNNING)); 
     778  BAIL_ON_RUNNING_CHECK(check); 
    779779  check->flags |= NP_RUNNING; 
    780780 
  • src/modules/mysql.c

    r7a237a2 rde52002  
    360360 
    361361  /* We cannot be running */ 
    362   assert(!(check->flags & NP_RUNNING)); 
     362  BAIL_ON_RUNNING_CHECK(check); 
    363363  check->flags |= NP_RUNNING; 
    364364 
  • src/modules/ping_icmp.c

    r7a237a2 rde52002  
    516516  int count = PING_COUNT; 
    517517 
     518  BAIL_ON_RUNNING_CHECK(check); 
     519 
    518520  if(noit_hash_retr_str(check->config, "interval", strlen("interval"), 
    519521                        &config_val)) 
  • src/modules/postgres.c

    r7a237a2 rde52002  
    296296 
    297297  /* We cannot be running */ 
    298   assert(!(check->flags & NP_RUNNING)); 
     298  BAIL_ON_RUNNING_CHECK(check); 
    299299  check->flags |= NP_RUNNING; 
    300300 
  • src/modules/selfcheck.c

    r7a237a2 rde52002  
    200200 
    201201  /* We cannot be running */ 
    202   assert(!(check->flags & NP_RUNNING)); 
     202  BAIL_ON_RUNNING_CHECK(check); 
    203203  check->flags |= NP_RUNNING; 
    204204 
  • src/modules/snmp.c

    r1108660 rde52002  
    942942  info->timedout = 0; 
    943943 
     944  BAIL_ON_RUNNING_CHECK(check); 
    944945  check->flags |= NP_RUNNING; 
    945946 
  • src/modules/ssh2.c

    r7a237a2 rde52002  
    292292 
    293293  /* We cannot be running */ 
    294   assert(!(check->flags & NP_RUNNING)); 
     294  BAIL_ON_RUNNING_CHECK(check); 
    295295  check->flags |= NP_RUNNING; 
    296296 
  • src/modules/test_abort.c

    r7a237a2 rde52002  
    160160  noitL(nlerr, "test_abort_initiate\n"); 
    161161  /* We cannot be running */ 
    162   assert(!(check->flags & NP_RUNNING)); 
     162  BAIL_ON_RUNNING_CHECK(check); 
    163163  check->flags |= NP_RUNNING; 
    164164 
  • src/noit_check_tools.h

    r204ecdc rde52002  
    132132                (void *closure, noit_module_t *self, noit_check_t *check, noit_check_t *cause)) 
    133133 
     134#define BAIL_ON_RUNNING_CHECK(check) do { \ 
     135  if(check->flags & NP_RUNNING) { \ 
     136    noitL(noit_error, "Check %s is still running!\n", check->name); \ 
     137    return -1; \ 
     138  } \ 
     139} while(0) 
     140 
    134141#define INITIATE_CHECK(func, self, check, cause) do { \ 
    135142  if(once) { \